summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2016-08-31 20:37:39 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2016-08-31 20:37:39 +0000
commit0786d5b9e6a24f5194ed3e988c865ebfb2a75896 (patch)
tree87a3f43a441cefdc90e4a4d16fab6025215ab31d /clang/lib/Sema
parent598124296b617809244128602e616024577027ef (diff)
downloadbcm5719-llvm-0786d5b9e6a24f5194ed3e988c865ebfb2a75896.tar.gz
bcm5719-llvm-0786d5b9e6a24f5194ed3e988c865ebfb2a75896.zip
Fix mishandling of deletedness for assignment operators of classes with
indirect virtual bases. We don't need to be able to invoke such an assignment operator from the derived class, and we shouldn't delete the derived assignment op if we can't do so. llvm-svn: 280288
Diffstat (limited to 'clang/lib/Sema')
-rw-r--r--clang/lib/Sema/SemaDeclCXX.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 585cd04d064..eb8c3d2cc83 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -6765,13 +6765,14 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM,
SpecialMemberDeletionInfo SMI(*this, MD, CSM, ICI, Diagnose);
for (auto &BI : RD->bases())
- if (!BI.isVirtual() &&
+ if ((SMI.IsAssignment || !BI.isVirtual()) &&
SMI.shouldDeleteForBase(&BI))
return true;
// Per DR1611, do not consider virtual bases of constructors of abstract
- // classes, since we are not going to construct them.
- if (!RD->isAbstract() || !SMI.IsConstructor) {
+ // classes, since we are not going to construct them. For assignment
+ // operators, we only assign (and thus only consider) direct bases.
+ if ((!RD->isAbstract() || !SMI.IsConstructor) && !SMI.IsAssignment) {
for (auto &BI : RD->vbases())
if (SMI.shouldDeleteForBase(&BI))
return true;
OpenPOWER on IntegriCloud