diff options
author | Larisse Voufo <lvoufo@google.com> | 2015-02-22 06:36:53 +0000 |
---|---|---|
committer | Larisse Voufo <lvoufo@google.com> | 2015-02-22 06:36:53 +0000 |
commit | a65298af650dd10cc8fa439e46d1a1ec4d1e5555 (patch) | |
tree | f85a90bb1c937285fa2ae64215abe3264f723d11 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | 01c97c08608f9e676f73439145b2e8a9552f0369 (diff) | |
download | bcm5719-llvm-a65298af650dd10cc8fa439e46d1a1ec4d1e5555.tar.gz bcm5719-llvm-a65298af650dd10cc8fa439e46d1a1ec4d1e5555.zip |
Relax the requirement on sized deallocation a bit: Default on unsized delete if sized delete is not provided in global scope, and -fdefine-sized-deallocation option is disabled.
llvm-svn: 230160
Diffstat (limited to 'clang/lib/Sema/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index 9ca7130f15c..53b75acbe3d 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -2089,6 +2089,15 @@ void Sema::DeclareGlobalAllocationFunction(DeclarationName Name, } } } + + // If the function is sized operator delete and has not already been + // declared, and weak definitions have been disabled, do not declare + // it implicitly. Instead, let deallocation function lookup pick up + // unsized delete. + // FIXME: We should remove this guard once backward compatibility is + // no longer an issue + if (NumParams == 2 && !getLangOpts().DefineSizedDeallocation) + return; FunctionProtoType::ExtProtoInfo EPI; |