This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53863] New: misleading error message for redefinitions
- From: "akim.demaille at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jul 2012 10:21:44 +0000
- Subject: [Bug c++/53863] New: misleading error message for redefinitions
- Auto-submitted: auto-generated
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!