[C++ testcases] PR 54250, PR 60305
Paolo Carlini
paolo.carlini@oracle.com
Tue Mar 18 17:17:00 GMT 2014
Hi,
I'm adding the below testcases for bugs already fixed in mainline and 4.8.x.
Thanks,
Paolo.
//////////////////
-------------- next part --------------
2014-03-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/54250
* g++.dg/cpp0x/lambda/lambda-ice12.C: New.
-------------- next part --------------
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);
+ }();
+ }
+};
-------------- next part --------------
2014-03-18 Paolo Carlini <paolo.carlini@oracle.com>
PR c++/60305
* g++.dg/cpp0x/constexpr-ice14.C: New.
-------------- next part --------------
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>();
More information about the Gcc-patches
mailing list