diff options
author | Jason Merrill <jason@redhat.com> | 2018-05-22 23:52:49 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2018-05-22 23:52:49 -0400 |
commit | 0d2e69cb3c08f44a15415fb264bf438bb8c9707c (patch) | |
tree | 9dce8d90a44b1df615ee30d9750592be1b9d35bb /gcc/testsuite/g++.dg | |
parent | 720820185fc3f63792b2e1d0ed9482768ee64c76 (diff) | |
download | gcc-0d2e69cb3c08f44a15415fb264bf438bb8c9707c.zip gcc-0d2e69cb3c08f44a15415fb264bf438bb8c9707c.tar.gz gcc-0d2e69cb3c08f44a15415fb264bf438bb8c9707c.tar.bz2 |
PR c++/85866 - error with .* in default template arg.
* pt.c (tsubst_copy_and_build): Handle partial instantiation.
From-SVN: r260562
Diffstat (limited to 'gcc/testsuite/g++.dg')
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C new file mode 100644 index 0000000..833049c --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/fntmpdefarg9.C @@ -0,0 +1,29 @@ +// PR c++/85866 +// { dg-do compile { target c++11 } } + +template<typename _Tp, typename _Up = _Tp&&> +_Up +__declval(int); + +template<typename _Tp> +_Tp +__declval(long); + +template<typename _Tp> +auto declval() noexcept -> decltype(__declval<_Tp>(0)); + +template<typename...> +using void_t = void; + +template<typename U, typename V, + void_t<decltype ( (declval<U>().*declval<V>()) () ) + >* = nullptr> +void boom(){} + +struct Foo { + void bar(){} +}; + +int main() { + boom<Foo, decltype(&Foo::bar)>(); +} |