Open
Description
In C++03, Clang claims that a struct containing a member with a deleted assignment operator is assignable, but diagnoses the instantiation as using a deleted function.
struct Element {
Element& operator=(const Element&) = delete;
};
struct S {
Element i;
S& operator=(const S&) = default;
};
_Static_assert(!__is_trivially_assignable(S&, const S&)); // assertion fails
_Static_assert(!__is_assignable(S&, const S&)); // assertion fails
void test() {
S s;
S s2;
s2 = s; // diagnosed as an error
}
(Godbolt)