From e4b7111409eaf52d327a92c32a4ddf7d6e33d47b Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Mon, 23 May 2016 09:23:42 +0000 Subject: [PATCH] re PR c++/53401 ([C++11] internal compiler error: Segmentation fault on infinite argument deduction of constexpr templates) 2016-05-23 Paolo Carlini PR c++/53401 * g++.dg/cpp0x/decltype64.C: New. From-SVN: r236581 --- gcc/testsuite/ChangeLog | 5 ++++ gcc/testsuite/g++.dg/cpp0x/decltype64.C | 32 +++++++++++++++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/decltype64.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 64b691dd0e4..215de618ca1 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-05-23 Paolo Carlini + + PR c++/53401 + * g++.dg/cpp0x/decltype64.C: New. + 2016-05-23 Christophe Lyon * 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 00000000000..46d18594c94 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/decltype64.C @@ -0,0 +1,32 @@ +// PR c++/53401 +// { dg-do compile { target c++11 } } + +template +struct index +{}; + +constexpr int recursive_impl(index<0u>) +{ + return 0; +} + +template +constexpr auto recursive_impl(index) + -> decltype(recursive_impl(index())) // { dg-error "depth" } +{ + return recursive_impl(index()); +} + +template +constexpr auto recursive() + -> decltype(recursive_impl(index())) +{ + return recursive_impl(index()); +} + +void f(int i) +{ + recursive<1>(); // { dg-message "from here" } +} + +// { dg-prune-output "compilation terminated" } -- 2.30.2