diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-05 08:30:59 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2013-12-05 08:30:59 +0000 |
commit | f03bd30854adf16bc30fce18120ef5f31954275e (patch) | |
tree | 5759e1b3762dd5c08f4bdec0e6b220248d94054f /clang/lib/Sema/SemaDeclCXX.cpp | |
parent | 9ef5775a949d2c78ba01169d0eca962f5d7c1ae7 (diff) | |
download | bcm5719-llvm-f03bd30854adf16bc30fce18120ef5f31954275e.tar.gz bcm5719-llvm-f03bd30854adf16bc30fce18120ef5f31954275e.zip |
PR17983: Fix crasher bug in C++1y mode when performing a non-global array
delete on a class which has no array cookie and has no class-specific operator
new.
llvm-svn: 196488
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 162e46ecab1..846aba89727 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -6192,6 +6192,10 @@ bool Sema::CheckDestructor(CXXDestructorDecl *Destructor) { Context.DeclarationNames.getCXXOperatorName(OO_Delete); if (FindDeallocationFunction(Loc, RD, Name, OperatorDelete)) return true; + // If there's no class-specific operator delete, look up the global + // non-array delete. + if (!OperatorDelete) + OperatorDelete = FindUsualDeallocationFunction(Loc, true, Name); MarkFunctionReferenced(Loc, OperatorDelete); |