From ee9661d435ccb883fe737e14813e24405942971c Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 24 Dec 2015 22:24:51 -0500 Subject: re PR c++/69005 (infinite(?) recursion in template instantiations) PR c++/69005 * call.c (add_template_candidate_real): Don't try to deduce X(X). From-SVN: r231952 --- gcc/testsuite/g++.dg/cpp0x/defaulted50.C | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/defaulted50.C (limited to 'gcc/testsuite') diff --git a/gcc/testsuite/g++.dg/cpp0x/defaulted50.C b/gcc/testsuite/g++.dg/cpp0x/defaulted50.C new file mode 100644 index 0000000..fea4537 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/defaulted50.C @@ -0,0 +1,27 @@ +// PR c++/69005 +// { dg-do compile { target c++11 } } + +template T& declval(); + +template class function; + +template +struct function<_Res(_Arg)> +{ + function() noexcept { } + + function(const function&) { } + + template()(declval<_Arg>()))> + function(_Functor) { } + + _Res operator()(_Arg) const; +}; + +struct Foo { + function Func; +}; + +extern Foo exfoo; +Foo f (exfoo); -- cgit v1.1