From 99f1498eedb30b9899ddc707a984d5af5293a10e Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Wed, 11 Oct 2017 08:50:15 +0000 Subject: [PATCH] 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 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C | 15 +++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C 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(); +} -- 2.30.2