From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28899 invoked by alias); 13 May 2014 05:10:48 -0000 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 Received: (qmail 28851 invoked by uid 48); 13 May 2014 05:10:43 -0000 From: "tromey at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61162] possibly bad error location with -Wc++-compat Date: Tue, 13 May 2014 05:10:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: tromey at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01088.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D61162 --- Comment #2 from Tom Tromey --- Note that it is also wrong for a conversion diagnosed in a "return": enum e { ZERO =3D 0, ONE }; enum e f(void) { return 0; } barimba. gcc --syntax-only -Wc++-compat r.c r.c: In function =E2=80=98f=E2=80=99: r.c:5:3: warning: enum conversion in return is invalid in C++ [-Wc++-compat] return 0; ^ I think it should point to the expression. >>From gcc-bugs-return-451397-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Tue May 13 05:32:21 2014 Return-Path: Delivered-To: listarch-gcc-bugs@gcc.gnu.org Received: (qmail 5198 invoked by alias); 13 May 2014 05:32:20 -0000 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 Delivered-To: mailing list gcc-bugs@gcc.gnu.org Received: (qmail 5166 invoked by uid 48); 13 May 2014 05:32:15 -0000 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c/61162] possibly bad error location with -Wc++-compat Date: Tue, 13 May 2014 05:32:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: mpolacek at gcc dot gnu.org X-Bugzilla-Target-Milestone: 4.10.0 X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-05/txt/msg01089.txt.bz2 Content-length: 208 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61162 --- Comment #3 from Marek Polacek --- I posted a patch, but the location for a return stmt will need more surgery than that.