From: Paolo Carlini Date: Thu, 21 Jan 2016 10:55:30 +0000 (+0000) Subject: re PR c++/58046 (template operator= in SFINAE class) X-Git-Tag: basepoints/gcc-7~1429 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aede6748d0abe3e4ec03f0d44f4e784725a9c595;p=thirdparty%2Fgcc.git re PR c++/58046 (template operator= in SFINAE class) 2016-01-21 Paolo Carlini PR c++/58046 * g++.dg/cpp0x/pr58046.C: New. From-SVN: r232671 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 3ef65ab9546d..25b72d7e0e6d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2016-01-21 Paolo Carlini + + PR c++/58046 + * g++.dg/cpp0x/pr58046.C: New. + 2016-01-21 Jakub Jelinek PR target/69187 diff --git a/gcc/testsuite/g++.dg/cpp0x/pr58046.C b/gcc/testsuite/g++.dg/cpp0x/pr58046.C new file mode 100644 index 000000000000..b2c0541e9510 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/pr58046.C @@ -0,0 +1,39 @@ +// { dg-do compile { target c++11 } } + +template +struct enable_if {}; + +template +struct enable_if +{ + using type = T; +}; + +template +struct is_true +{ + static constexpr bool value = true; +}; + +extern void* enabler; + +template ::value>::type*& = enabler> +class A +{ +public: + A() + {} + template + A& operator=( A&& ) + { + return *this; + } +}; + +int main() +{ + A a_i; + A a_d; + + a_i = a_d; // { dg-error "cannot bind" } +}