re PR c++/77522 (ICE on invalid code C++14 code: in tsubst_decl, at cp/pt.c:12447)
authorPaolo Carlini <paolo.carlini@oracle.com>
Fri, 9 Feb 2018 11:37:14 +0000 (11:37 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Fri, 9 Feb 2018 11:37:14 +0000 (11:37 +0000)
2018-02-09  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/77522
* g++.dg/cpp1y/lambda-init16.C: New.

From-SVN: r257521

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

index 544ebefe0b625626a4b525ca91d2ac88c58b3783..ff8136e2234105a546197368fbf4ffb3fc86f142 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-09  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/77522
+       * g++.dg/cpp1y/lambda-init16.C: New.
+
 2018-02-09  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/sso8.adb: New test.
diff --git a/gcc/testsuite/g++.dg/cpp1y/lambda-init16.C b/gcc/testsuite/g++.dg/cpp1y/lambda-init16.C
new file mode 100644 (file)
index 0000000..0a40ebb
--- /dev/null
@@ -0,0 +1,13 @@
+// PR c++/77522
+// { dg-do compile { target c++14 } }
+
+template < class T = int > void f (T)
+{
+  auto g = [&a = f] () {};  // { dg-error "invalid initialization" }
+}
+
+int main ()
+{
+  f (0);
+  return 0;
+}