[Bug c++/52683] assignment operator not detected

abominable-snowman at yandex dot ru gcc-bugzilla@gcc.gnu.org
Fri Mar 23 14:25:00 GMT 2012


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52683

--- Comment #3 from Petr Ovtchenkov <abominable-snowman at yandex dot ru> 2012-03-23 13:54:23 UTC ---
> W::operator= is an overloaded function,  operator=(const W&) and operator=(W&&)
>
> decltype cannot work, because an overload set is not a type

I'm agree. But if you remove all tests with is_assignable2, still remains
problem with int:

...
struct QQ
{
  int v;
};

...

static_assert( is_assignable<int,int>::value, "not assignable" ); // <----
fail!
static_assert( is_assignable<int&,int&&>::value, "not assignable" ); // pass
...
static_assert( is_assignable<WW,WW>::value, "not assignable" ); // pass
...
static_assert( is_assignable<QQ,QQ>::value, "not assignable" ); // <---- pass!
static_assert( is_assignable<QQ&,QQ&&>::value, "not assignable" ); // pass



More information about the Gcc-bugs mailing list