You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Part of the work for #141911.
Checking `is_assignable<T, U>` boils down to checking the
well-formedness of `declval<T>() = declval<U>()`; this PR recycles logic
from EvaluateBinaryTypeTrait in order to produce the relevant
diagnostics.
// expected-note@#a-S2 {{candidate function (the implicit copy assignment operator) not viable: 'this' argument has type 'const S2', but method is not marked const}} \
532
+
// expected-note@#a-S2 {{candidate function (the implicit move assignment operator) not viable: 'this' argument has type 'const S2', but method is not marked const}} \
533
+
// expected-note@#a-S2 {{'S2' defined here}}
534
+
535
+
structS3 { // #a-S3
536
+
S3& operator=(const S3&) = delete; // #aca-S3
537
+
S3& operator=(S3&&) = delete; // #ama-S3
538
+
};
539
+
static_assert(__is_assignable(S3, const S3&));
540
+
// expected-error@-1 {{static assertion failed due to requirement '__is_assignable(assignable::S3, const assignable::S3 &)'}} \
0 commit comments