diff options
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); |