This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/53863] misleading error message for redefinitions
- From: "redi at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Thu, 05 Jul 2012 10:45:51 +0000
- Subject: [Bug c++/53863] misleading error message for redefinitions
- Auto-submitted: auto-generated
- References: <bug-53863-4@http.gcc.gnu.org/bugzilla/>
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53863
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |diagnostic
--- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-07-05 10:45:51 UTC ---
In the words of the C++ standard "a = 1" is an "enumerator-definition", which
declares the name "a"
(EDG says declaration for C and C++, Clang says definition for C and C++)
I think the reason for the G++ wording is that the same diagnostic is used in
this case:
extern int a;
extern long a;
t.cc:2:13: error: conflicting declaration 'long int a'
t.cc:1:12: error: 'a' has a previous declaration as 'int a'
And in this case they are declarations, not definitions.
Interestingly the C front end gives a different diagnostic here, changing
"definition" to "declaration"
t.c:2:13: error: conflicting types for 'a'
t.c:1:12: note: previous declaration of 'a' was here