From b2f0f057421309b628d51b4c260392d228c4993a Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Mon, 10 Oct 2016 18:54:32 +0000 Subject: Re-commit r283722, reverted in r283750, with a fix for a CUDA-specific use of past-the-end iterator. Original commit message: P0035R4: Semantic analysis and code generation for C++17 overaligned allocation. llvm-svn: 283789 --- clang/lib/Sema/SemaDecl.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Sema/SemaDecl.cpp') diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 32201c99d3d..7baa85a6464 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -14368,6 +14368,14 @@ void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, if (!Completed) Record->completeDefinition(); + // We may have deferred checking for a deleted destructor. Check now. + if (CXXRecordDecl *CXXRecord = dyn_cast(Record)) { + auto *Dtor = CXXRecord->getDestructor(); + if (Dtor && Dtor->isImplicit() && + ShouldDeleteSpecialMember(Dtor, CXXDestructor)) + SetDeclDeleted(Dtor, CXXRecord->getLocation()); + } + if (Record->hasAttrs()) { CheckAlignasUnderalignment(Record); -- cgit v1.2.3