aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/constexpr-48324.C13
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 585c912..9e55738 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2015-03-20 Paolo Carlini <paolo.carlini@oracle.com>
+ PR c++/48324
+ * g++.dg/cpp0x/constexpr-48324.C: New.
+
+2015-03-20 Paolo Carlini <paolo.carlini@oracle.com>
+
PR c++/48453
* g++.dg/cpp0x/pr48453.C: New.
diff --git a/gcc/testsuite/g++.dg/cpp0x/constexpr-48324.C b/gcc/testsuite/g++.dg/cpp0x/constexpr-48324.C
new file mode 100644
index 0000000..cef464c
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/constexpr-48324.C
@@ -0,0 +1,13 @@
+// PR c++/48324
+// { dg-do compile { target c++11 } }
+
+struct S {
+ const int val;
+ constexpr S(int i) : val(i) { }
+};
+
+constexpr const int& to_ref(int i) {
+ return S(i).val; // { dg-warning "reference to temporary" }
+}
+
+constexpr int ary[to_ref(98)] = { }; // { dg-error "not an integral" }