diff options
author | Jason Merrill <jason@redhat.com> | 2015-12-24 22:24:51 -0500 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2015-12-24 22:24:51 -0500 |
commit | ee9661d435ccb883fe737e14813e24405942971c (patch) | |
tree | e65fcae433ddcb754e0829e802b900eff22a553a /gcc/testsuite | |
parent | 36e7989ff07dab6bbf4e2f7ea1b577a4027c4772 (diff) | |
download | gcc-ee9661d435ccb883fe737e14813e24405942971c.zip gcc-ee9661d435ccb883fe737e14813e24405942971c.tar.gz gcc-ee9661d435ccb883fe737e14813e24405942971c.tar.bz2 |
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
Diffstat (limited to 'gcc/testsuite')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/defaulted50.C | 27 |
1 files changed, 27 insertions, 0 deletions
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<typename T> T& declval(); + +template<typename _Sig> class function; + +template<typename _Res, typename _Arg> +struct function<_Res(_Arg)> +{ + function() noexcept { } + + function(const function&) { } + + template<typename _Functor, + typename = decltype(declval<_Functor&>()(declval<_Arg>()))> + function(_Functor) { } + + _Res operator()(_Arg) const; +}; + +struct Foo { + function<void(Foo)> Func; +}; + +extern Foo exfoo; +Foo f (exfoo); |