From eacb22bf7330f5d8164e0742d4b0dda956865d44 Mon Sep 17 00:00:00 2001 From: Paolo Carlini Date: Fri, 3 May 2013 09:35:42 +0000 Subject: [PATCH] re PR c++/54318 ([C++11] Bogus "template instantiation depth exceeds maximum" error + segfault) 2013-05-03 Paolo Carlini PR c++/54318 * g++.dg/cpp0x/pr54318.C: New. From-SVN: r198573 --- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/pr54318.C | 24 ++++++++++++++++++++++++ 2 files changed, 29 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/pr54318.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 88ac42033b7..b7163534e82 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2013-05-03 Paolo Carlini + + PR c++/54318 + * g++.dg/cpp0x/pr54318.C: New. + 2013-05-03 Paolo Carlini PR c++/14283 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr54318.C b/gcc/testsuite/g++.dg/cpp0x/pr54318.C new file mode 100644 index 00000000000..4dac31b883a --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr54318.C @@ -0,0 +1,24 @@ +// PR c++/54318 +// { dg-do compile { target c++11 } } + +template +struct wrapped +{ + typedef T type; +}; + +template +typename T::type unwrap1(T); + +int unwrap(int); + +template +auto unwrap(T t) -> decltype(unwrap(unwrap1(t))) +{ + return unwrap(unwrap1(t)); +} + +int main() +{ + unwrap(wrapped>()); +} -- 2.30.2