summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CodeGenFunction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/CodeGen/CodeGenFunction.cpp')
-rw-r--r--clang/lib/CodeGen/CodeGenFunction.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/clang/lib/CodeGen/CodeGenFunction.cpp b/clang/lib/CodeGen/CodeGenFunction.cpp
index 79425d4c21e..4d03bdb8ef4 100644
--- a/clang/lib/CodeGen/CodeGenFunction.cpp
+++ b/clang/lib/CodeGen/CodeGenFunction.cpp
@@ -891,8 +891,11 @@ void CodeGenFunction::GenerateCode(GlobalDecl GD, llvm::Function *Fn,
} else if (FunctionDecl *UnsizedDealloc =
FD->getCorrespondingUnsizedGlobalDeallocationFunction()) {
// Global sized deallocation functions get an implicit weak definition if
- // they don't have an explicit definition.
+ // they don't have an explicit definition, if allowed.
+ assert(getLangOpts().DefaultSizedDelete &&
+ "Can't emit unallowed definition.");
EmitSizedDeallocationFunction(*this, UnsizedDealloc);
+
} else
llvm_unreachable("no definition for emitted function");
OpenPOWER on IntegriCloud