This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/64232] Derived class with implicitly declared assignment operator is std::is_assignable though base class is not std::is_assignable
- From: "mmehlich at semanticdesigns dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Dec 2014 21:49:02 +0000
- Subject: [Bug c++/64232] Derived class with implicitly declared assignment operator is std::is_assignable though base class is not std::is_assignable
- Auto-submitted: auto-generated
- References: <bug-64232-4 at http dot gcc dot gnu dot org/bugzilla/>
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).