From 5b34958b46dc14267d1b06099c3bd43e748716fc Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Fri, 13 Oct 2017 01:55:36 +0000 Subject: Support for destroying operator delete, per C++2a proposal P0722. This feature is not (yet) approved by the C++ committee, so this is liable to be reverted or significantly modified based on committee feedback. No functionality change intended for existing code (a new type must be defined in namespace std to take advantage of this feature). llvm-svn: 315662 --- clang/lib/Serialization/ASTReaderDecl.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'clang/lib/Serialization/ASTReaderDecl.cpp') diff --git a/clang/lib/Serialization/ASTReaderDecl.cpp b/clang/lib/Serialization/ASTReaderDecl.cpp index 1283b006dfb..c3c6c3e3d88 100644 --- a/clang/lib/Serialization/ASTReaderDecl.cpp +++ b/clang/lib/Serialization/ASTReaderDecl.cpp @@ -1901,9 +1901,12 @@ void ASTDeclReader::VisitCXXDestructorDecl(CXXDestructorDecl *D) { if (auto *OperatorDelete = ReadDeclAs()) { auto *Canon = cast(D->getCanonicalDecl()); + auto *ThisArg = Record.readExpr(); // FIXME: Check consistency if we have an old and new operator delete. - if (!Canon->OperatorDelete) + if (!Canon->OperatorDelete) { Canon->OperatorDelete = OperatorDelete; + Canon->OperatorDeleteThisArg = ThisArg; + } } } @@ -4113,9 +4116,12 @@ void ASTDeclReader::UpdateDecl(Decl *D, // record. auto *Del = ReadDeclAs(); auto *First = cast(D->getCanonicalDecl()); + auto *ThisArg = Record.readExpr(); // FIXME: Check consistency if we have an old and new operator delete. - if (!First->OperatorDelete) + if (!First->OperatorDelete) { First->OperatorDelete = Del; + First->OperatorDeleteThisArg = ThisArg; + } break; } -- cgit v1.2.3