aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C
diff options
context:
space:
mode:
Diffstat (limited to 'gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C')
-rw-r--r--gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C11
1 files changed, 11 insertions, 0 deletions
diff --git a/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C
new file mode 100644
index 0000000..fb7570f
--- /dev/null
+++ b/gcc-4.9/gcc/testsuite/g++.dg/cpp0x/constexpr-ice.C
@@ -0,0 +1,11 @@
+// We used to crash on this instead of giving a decent error.
+// { dg-do compile { target c++11 } }
+
+struct A { int i; };
+
+struct B {
+ const A *a;
+ constexpr B(const A& a): a(&a) { }
+};
+
+constexpr B b{A{42}}; // { dg-error "constant|expansion" }