From: Paolo Carlini Date: Wed, 11 Oct 2017 08:50:15 +0000 (+0000) Subject: re PR c++/81299 (Spurious "set but not used" warning with constexpr variable) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=99f1498eedb30b9899ddc707a984d5af5293a10e;p=gcc.git re PR c++/81299 (Spurious "set but not used" warning with constexpr variable) 2017-10-11 Paolo Carlini PR c++/81299 * g++.dg/cpp1y/lambda-generic-ice7.C: New. From-SVN: r253630 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index f1ee90e687b..fef42859f25 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2017-10-11 Paolo Carlini + + PR c++/81299 + * g++.dg/cpp1y/lambda-generic-ice7.C: New. + 2017-10-10 Nathan Sidwell * g++.dg/lookup/extern-c-redecl6.C: New. diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C new file mode 100644 index 00000000000..fa0fe1ddaf9 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C @@ -0,0 +1,15 @@ +// PR c++/81299 +// { dg-do compile { target c++14 } } +// { dg-options "-Wall" } + +struct function_t { + template + void operator()(Xs&& ...) const { } +}; +constexpr function_t function{}; + +int main() { + constexpr auto fun = ::function; + auto call = [=](auto ...x) { fun(x...); }; + call(); +}