Take cv-qualifiers on fields of class type into account when determining

whether a defaulted special member function should be deleted.

llvm-svn: 195620
This commit is contained in:
Richard Smith
2013-11-25 07:07:05 +00:00
parent 52b9cbf880
commit c91d12ce80
6 changed files with 57 additions and 3 deletions

View File

@@ -4913,6 +4913,10 @@ struct SpecialMemberDeletionInfo {
// cv-qualifiers on class members don't affect default ctor / dtor calls.
if (CSM == Sema::CXXDefaultConstructor || CSM == Sema::CXXDestructor)
Quals = 0;
// cv-qualifiers on class members affect the type of both '*this' and the
// argument for an assignment.
if (IsAssignment)
TQ |= Quals;
return S.LookupSpecialMember(Class, CSM,
ConstArg || (Quals & Qualifiers::Const),
VolatileArg || (Quals & Qualifiers::Volatile),