Commit 036c9eb5 by Jakub Jelinek Committed by Jakub Jelinek

re PR c++/85108 (Incorrect warning for constexpr lambda with -Wunused-but-set-variable)

	PR c++/85108
	* g++.dg/warn/Wunused-var-31.C: New test.

From-SVN: r258952
parent 972e1985
2018-03-29 Jakub Jelinek <jakub@redhat.com>
PR c++/85108
* g++.dg/warn/Wunused-var-31.C: New test.
PR c/85094
* c-c++-common/Wduplicated-branches-14.c: New test.
......
// PR c++/85108
// { dg-do compile { target c++17 } }
// { dg-options "-Wunused-but-set-variable" }
int
main ()
{
auto constexpr add = [] (auto a, auto b) { return a + b; }; // { dg-bogus "set but not used" }
auto test_lambda = [&] () { return add (2, 2); };
return test_lambda () - 4;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment