aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2016-05-23 09:23:42 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2016-05-23 09:23:42 +0000
commite4b7111409eaf52d327a92c32a4ddf7d6e33d47b (patch)
treeac42648b1e07e6864a40529bc1ed923c69a74d47 /gcc
parenta25a8058d58eb9a6d3863c01a4f005a1e0204d32 (diff)
downloadgcc-e4b7111409eaf52d327a92c32a4ddf7d6e33d47b.zip
gcc-e4b7111409eaf52d327a92c32a4ddf7d6e33d47b.tar.gz
gcc-e4b7111409eaf52d327a92c32a4ddf7d6e33d47b.tar.bz2
re PR c++/53401 ([C++11] internal compiler error: Segmentation fault on infinite argument deduction of constexpr templates)
2016-05-23 Paolo Carlini <paolo.carlini@oracle.com> PR c++/53401 * g++.dg/cpp0x/decltype64.C: New. From-SVN: r236581
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/decltype64.C32
2 files changed, 37 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 64b691d..215de61 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2016-05-23 Paolo Carlini <paolo.carlini@oracle.com>
+
+ PR c++/53401
+ * g++.dg/cpp0x/decltype64.C: New.
+
2016-05-23 Christophe Lyon <christophe.lyon@linaro.org>
* gcc.target/aarch64/advsimd-intrinsics/vreinterpret.c: Add fp16 tests.
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype64.C b/gcc/testsuite/g++.dg/cpp0x/decltype64.C
new file mode 100644
index 0000000..46d1859
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype64.C
@@ -0,0 +1,32 @@
+// PR c++/53401
+// { dg-do compile { target c++11 } }
+
+template<int I>
+struct index
+{};
+
+constexpr int recursive_impl(index<0u>)
+{
+ return 0;
+}
+
+template<int N>
+constexpr auto recursive_impl(index<N>)
+ -> decltype(recursive_impl(index<N - 1>())) // { dg-error "depth" }
+{
+ return recursive_impl(index<N - 1>());
+}
+
+template<int N>
+constexpr auto recursive()
+ -> decltype(recursive_impl(index<N>()))
+{
+ return recursive_impl(index<N>());
+}
+
+void f(int i)
+{
+ recursive<1>(); // { dg-message "from here" }
+}
+
+// { dg-prune-output "compilation terminated" }