diff mbox

[C++,testcases] PR 54250, PR 60305

Message ID 53287AB6.7040702@oracle.com
State New
Headers show

Commit Message

Paolo Carlini March 18, 2014, 4:56 p.m. UTC
Hi,

I'm adding the below testcases for bugs already fixed in mainline and 4.8.x.

Thanks,
Paolo.

//////////////////
2014-03-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/54250
	* g++.dg/cpp0x/lambda/lambda-ice12.C: New.

2014-03-18  Paolo Carlini  <paolo.carlini@oracle.com>

	PR c++/60305
	* g++.dg/cpp0x/constexpr-ice14.C: New.
Index: g++.dg/cpp0x/constexpr-ice14.C
===================================================================
--- g++.dg/cpp0x/constexpr-ice14.C	(revision 0)
+++ g++.dg/cpp0x/constexpr-ice14.C	(working copy)
@@ -0,0 +1,11 @@
+// PR c++/60305
+// { dg-do compile { target c++11 } }
+
+template<int I> int foo() { return I; }
+
+template<int... I> void bar()
+{
+  constexpr int (*X[])() = { foo<I>... };
+}
+
+template void bar<1,3,5>();
diff mbox

Patch

Index: g++.dg/cpp0x/constexpr-ice14.C
===================================================================
--- g++.dg/cpp0x/constexpr-ice14.C	(revision 0)
+++ g++.dg/cpp0x/constexpr-ice14.C	(working copy)
@@ -0,0 +1,11 @@ 
+// PR c++/60305
+// { dg-do compile { target c++11 } }
+
+template<int I> int foo() { return I; }
+
+template<int... I> void bar()
+{
+  constexpr int (*X[])() = { foo<I>... };
+}
+
+template void bar<1,3,5>();
Index: g++.dg/cpp0x/lambda/lambda-ice12.C
===================================================================
--- g++.dg/cpp0x/lambda/lambda-ice12.C	(revision 0)
+++ g++.dg/cpp0x/lambda/lambda-ice12.C	(working copy)
@@ -0,0 +1,15 @@ 
+// PR c++/54250
+// { dg-do compile { target c++11 } }
+
+struct T
+{
+    int a;
+    int foo()
+    {
+        return [&]()->int {
+            return [&](decltype(/*this->*/a) _)->int {
+                return 1;
+            }(a);
+        }();
+    }
+};