re PR c++/81299 (Spurious "set but not used" warning with constexpr variable)
authorPaolo Carlini <paolo.carlini@oracle.com>
Wed, 11 Oct 2017 08:50:15 +0000 (08:50 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Wed, 11 Oct 2017 08:50:15 +0000 (08:50 +0000)
2017-10-11  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/81299
* g++.dg/cpp1y/lambda-generic-ice7.C: New.

From-SVN: r253630

gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp1y/lambda-generic-ice7.C [new file with mode: 0644]

index f1ee90e687bdc6e29aebc40d01dfa9c8d14b2a0b..fef42859f256956fb8926c72f617b5074b3c9cf3 100644 (file)
@@ -1,3 +1,8 @@
+2017-10-11  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/81299
+       * g++.dg/cpp1y/lambda-generic-ice7.C: New.
+
 2017-10-10  Nathan Sidwell  <nathan@acm.org>
 
        * 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 (file)
index 0000000..fa0fe1d
--- /dev/null
@@ -0,0 +1,15 @@
+// PR c++/81299
+// { dg-do compile { target c++14 } }
+// { dg-options "-Wall" }
+
+struct function_t {
+  template <typename ...Xs>
+  void operator()(Xs&& ...) const { }
+};
+constexpr function_t function{};
+
+int main() {
+  constexpr auto fun = ::function;
+  auto call = [=](auto ...x) { fun(x...); };
+  call();
+}