Opened 11 years ago

Closed 11 years ago

#6693 closed Bugs (invalid)

tribool.hpp causes warnings under -Wshadow on gcc

Reported by: Ben Craig <ben.craig@…> Owned by: Marshall Clow
Milestone: Boost 1.50.0 Component: logic
Version: Boost 1.49.0 Severity: Problem
Keywords: Cc:

Description

boost::logic::tribool's constructor accepts an argument "value", and it also has a data member named "value". This causes warnings under -Wshadow on gcc. I have attached a patch to fix this problem.

Attachments (1)

shadow.patch (438 bytes ) - added by Ben Craig <ben.craig@…> 11 years ago.
Patch to tribool shadowing issue

Download all attachments as: .zip

Change History (5)

by Ben Craig <ben.craig@…>, 11 years ago

Attachment: shadow.patch added

Patch to tribool shadowing issue

comment:1 by Ben Craig <ben.craig@…>, 11 years ago

Component: Nonelogic
Owner: set to Douglas Gregor

comment:2 by Marshall Clow, 11 years ago

Owner: changed from Douglas Gregor to Marshall Clow
Status: newassigned

Here's what I see in that file (both on trunk and release):

   * \throws nothrow
   */
  tribool(bool initial_value) : value(initial_value? true_value : false_value) {}

It appears to me that this was fixed back in 2009.

------------------------------------------------------------------------
r53429 | vladimir_prus | 2009-05-29 23:36:18 -0700 (Fri, 29 May 2009) | 4 lines

Fix gcc -Wshadow warnings in tribool.

Are you sure that you are using version 1.49?

comment:3 by Ben Craig <ben.craig@…>, 11 years ago

Arg! sorry about that. We use 1.46.1 internally, where we locally patched this problem, and two similar ones in the random library. When setting this patch up, I saw that everything in random had been cleared up, but I managed to forget / mess up this comparison.

This can be closed / rejected.

comment:4 by Marshall Clow, 11 years ago

Resolution: invalid
Status: assignedclosed
Note: See TracTickets for help on using tickets.