[Bug c++/53863] New: misleading error message for redefinitions
akim.demaille at gmail dot com
gcc-bugzilla@gcc.gnu.org
Thu Jul 5 10:21:00 GMT 2012
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!
More information about the Gcc-bugs
mailing list