This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/64232] Derived class with implicitly declared assignment operator is std::is_assignable though base class is not std::is_assignable


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64232

--- Comment #2 from Michael Mehlich <mmehlich at semanticdesigns dot com> ---
My expectation was that the compiler declares the copy assignment operator of Y
as deleted as its base class X is not assignable; std::is_assignable would then
just have to look at the copy constructor for Y and notice that it is deleted,
which would obviously be in the immediate context.
But arguably, 12.8 paragraph 34 item 4 only looks at the copy assignment
operator for X, not whether X can actually be copy-assigned, which - as the
example above shows - may require that the copy constructor for X is not
deleted.
By the way, std::is_nothrow_assign has the same problem (i.e. declaring X(const
X&) as throwing, and operator=(X x) as not throwing results in gcc claiming
that the copy assignment operator for Y is not throwing).


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]