[C++] Add test for c++/60366

Message ID 20190609154137.GZ5989@redhat.com
State New
Headers show
Series
  • [C++] Add test for c++/60366
Related show

Commit Message

Marek Polacek June 9, 2019, 3:41 p.m.
This one ICEd but was, curiously, fixed very recently by r271811.

Tested x86_64-linux, applying to trunk.

2019-06-09  Marek Polacek  <polacek@redhat.com>

	PR c++/60366
	* g++.dg/cpp0x/lambda/lambda-ice32.C: New test.

Patch

diff --git gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice32.C gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice32.C
new file mode 100644
index 00000000000..6f8d37c02e8
--- /dev/null
+++ gcc/testsuite/g++.dg/cpp0x/lambda/lambda-ice32.C
@@ -0,0 +1,9 @@ 
+// PR c++/60366
+// { dg-do compile { target c++11 } }
+
+void
+fn ()
+{
+  auto f = [](const struct __lambda0 &self) { self(self); }; // { dg-error "" }
+  f(f); // { dg-error "" }
+}