This C++ file:

enum E1 { V };
namespace { enum E2 { V }; }
int foo() { return static_cast<int>(V); }

when compiled with current mainline produces a doubled error message:

foo.cc: In function ‘int foo()’:
foo.cc:3: error: reference to ‘V’ is ambiguous
foo.cc:1: error: candidates are: E1 V
foo.cc:2: error:                 <unnamed>::E2 <unnamed>::V
foo.cc:3: error: reference to ‘V’ is ambiguous
foo.cc:1: error: candidates are: E1 V
foo.cc:2: error:                 <unnamed>::E2 <unnamed>::V

This duplication is pointless and confusing.


-- 
           Summary: Duplicate error message for ambiguous enum
           Product: gcc
           Version: 4.2.0
            Status: UNCONFIRMED
          Severity: minor
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ian at airs dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=27078

Reply via email to