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
This commit is contained in:
parent
972e1985d4
commit
036c9eb5d9
@ -1,5 +1,8 @@
|
|||||||
2018-03-29 Jakub Jelinek <jakub@redhat.com>
|
2018-03-29 Jakub Jelinek <jakub@redhat.com>
|
||||||
|
|
||||||
|
PR c++/85108
|
||||||
|
* g++.dg/warn/Wunused-var-31.C: New test.
|
||||||
|
|
||||||
PR c/85094
|
PR c/85094
|
||||||
* c-c++-common/Wduplicated-branches-14.c: New test.
|
* c-c++-common/Wduplicated-branches-14.c: New test.
|
||||||
|
|
||||||
|
11
gcc/testsuite/g++.dg/warn/Wunused-var-31.C
Normal file
11
gcc/testsuite/g++.dg/warn/Wunused-var-31.C
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
// 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;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user