This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/53863] New: misleading error message for redefinitions


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

             Bug #: 53863
           Summary: misleading error message for redefinitions
    Classification: Unclassified
           Product: gcc
           Version: 4.7.1
            Status: UNCONFIRMED
          Severity: enhancement
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: akim.demaille@gmail.com


Hi,

In my opinion gcc provides a clearer error than g++ does.

$ cat fo.c
enum { a = 1 };
enum { a = 1 };
$ gcc-mp-4.7 -Wall /tmp/fo.c
/tmp/fo.c:2:8: error: redeclaration of enumerator 'a'
/tmp/fo.c:1:8: note: previous definition of 'a' was here
$ g++-mp-4.7 -Wall /tmp/fo.c
/tmp/fo.c:2:12: error: conflicting declaration 'a'
/tmp/fo.c:1:8: error: 'a' has a previous declaration as '<anonymous enum> a'

(also, shouldn't it be about "definition" instead of "declaration"?
gcc has "previous definition" but "redeclaration", while g++ has "declaration"
twice)

Thanks for GCC!


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]