From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29576 invoked by alias); 5 Jul 2012 10:21:59 -0000 Received: (qmail 29568 invoked by uid 22791); 5 Jul 2012 10:21:58 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO gcc.gnu.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 05 Jul 2012 10:21:45 +0000 From: "akim.demaille at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/53863] New: misleading error message for redefinitions Date: Thu, 05 Jul 2012 10:21:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Keywords: X-Bugzilla-Severity: enhancement X-Bugzilla-Who: akim.demaille at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2012-07/txt/msg00519.txt.bz2 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 ' 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!