This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: lambda-switch regression
- From: David Malcolm <dmalcolm at redhat dot com>
- To: Nathan Sidwell <nathan at acm dot org>, GCC Patches <gcc-patches at gcc dot gnu dot org>, polacek at redhat dot com
- Date: Wed, 15 Nov 2017 12:06:14 -0500
- Subject: Re: lambda-switch regression
- Authentication-results: sourceware.org; auth=none
- References: <3654c425-cd63-2f2e-8039-cb175dce8634@acm.org>
On Wed, 2017-11-15 at 08:03 -0500, Nathan Sidwell wrote:
> g++.dg/lambda/lambda-switch.C Has recently regressed.
g++.dg/cpp0x/lambda/lambda-switch.C
> It appears the
> location of a warning message has moved.
>
> l = []() // { dg-warning "statement will never
> be executed" }
> {
> case 3: // { dg-error "case" }
> break; // { dg-error "break" }
> }; <--- warning now here
>
> We seem to be diagnosing the last line of the statement, not the
> first.
> That seems not a useful.
>
> I've not investigated what patch may have caused this, on the chance
> someone might already know?
>
> nathan
The warning was added in r236597 (aka
1398da0f786e120bb0b407e84f412aa9fc6d80ee):
+2016-05-23 Marek Polacek <polacek@redhat.com>
+
+ PR c/49859
+ * common.opt (Wswitch-unreachable): New option.
+ * doc/invoke.texi: Document -Wswitch-unreachable.
+ * gimplify.c (gimplify_switch_expr): Implement the -Wswitch-unreachable
+ warning.
which had it at there (23:7).
r244705 (aka 3ef7eab185e1463c7dbfa2a8d1af5d0120cf9f76) moved the
warning from 23:7 up to the "[] ()" at 19:6 in:
+2017-01-20 Marek Polacek <polacek@redhat.com>
+
+ PR c/64279
[...snip...]
+ * g++.dg/cpp0x/lambda/lambda-switch.C: Move dg-warning.
I tried it with some working copies I have to hand:
- works for me with r254387 (2017-11-03)
- fails for me with r254700 (2017-11-13)
so hopefully that helps track it down.
Dave