aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C31
1 files changed, 31 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
new file mode 100644
index 0000000..a8af2e6
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-incomplete2.C
@@ -0,0 +1,31 @@
+// A constructor that might or might not be constexpr still makes
+// its class literal.
+// { dg-do compile { target c++11 } }
+
+template <class T>
+struct B
+{
+ constexpr B(T) { }
+ constexpr B() {}
+};
+
+struct A
+{
+ B<A> b;
+};
+
+constexpr A a {};
+
+template <class T>
+struct C
+{
+ constexpr C(T) { }
+ C() {}
+};
+
+struct D
+{
+ C<D> c;
+};
+
+constexpr D d {}; // { dg-error "non-constexpr function" }