Index: clang/docs/ReleaseNotes.rst =================================================================== --- clang/docs/ReleaseNotes.rst +++ clang/docs/ReleaseNotes.rst @@ -186,6 +186,8 @@ - Clang now checks ODR violations when merging concepts from different modules. Note that this may possibly break existing code, and is done so intentionally. Fixes `Issue 56310 `_. +- Clang will now look through type sugar when checking a member function is a + move assignment operator. Fixes `Issue 56456 `_. Improvements to Clang's diagnostics ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ Index: clang/lib/AST/DeclCXX.cpp =================================================================== --- clang/lib/AST/DeclCXX.cpp +++ clang/lib/AST/DeclCXX.cpp @@ -2410,7 +2410,7 @@ return false; QualType ParamType = getParamDecl(0)->getType(); - if (!isa(ParamType)) + if (!ParamType->isRValueReferenceType()) return false; ParamType = ParamType->getPointeeType(); Index: clang/test/SemaCXX/cxx0x-defaulted-functions.cpp =================================================================== --- clang/test/SemaCXX/cxx0x-defaulted-functions.cpp +++ clang/test/SemaCXX/cxx0x-defaulted-functions.cpp @@ -259,3 +259,28 @@ static_assert(noexcept(A::B()), ""); } + +namespace GH56456 { +template +using RC=T const&; +template +using RV=T&; +template +using RM=T&&; + +struct A { + A(RC) = default; + A(RM) = default; + + auto operator=(RC) -> RV = default; + auto operator=(RM) -> RV = default; +}; + +struct B { + B (RC) = delete; + B (RM) = delete; + + auto operator = (RC) -> RV = delete; + auto operator = (RM) -> RV = delete; +}; +}