diff options
author | Reid Kleckner <rnk@google.com> | 2018-12-12 23:46:06 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2018-12-12 23:46:06 +0000 |
commit | 25b56024aa369df85e9c0d986ace6a5bac164664 (patch) | |
tree | 08b343d3128debe6359038d6fb9f5d2537edfe09 /clang/lib/CodeGen/CGCall.cpp | |
parent | e01c646ddaf76540880099402d7bbac4f188d10c (diff) | |
download | bcm5719-llvm-25b56024aa369df85e9c0d986ace6a5bac164664.tar.gz bcm5719-llvm-25b56024aa369df85e9c0d986ace6a5bac164664.zip |
Emit a proper diagnostic when attempting to forward inalloca arguments
The previous assertion was relatively easy to trigger, and likely will
be easy to trigger going forward. EmitDelegateCallArg is relatively
popular.
This cleanly diagnoses PR28299 while I work on a proper solution.
llvm-svn: 348991
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGCall.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp index 4757cd2ffae..b2c1eba0664 100644 --- a/clang/lib/CodeGen/CGCall.cpp +++ b/clang/lib/CodeGen/CGCall.cpp @@ -3076,8 +3076,9 @@ void CodeGenFunction::EmitDelegateCallArg(CallArgList &args, QualType type = param->getType(); - assert(!isInAllocaArgument(CGM.getCXXABI(), type) && - "cannot emit delegate call arguments for inalloca arguments!"); + if (isInAllocaArgument(CGM.getCXXABI(), type)) { + CGM.ErrorUnsupported(param, "forwarded non-trivially copyable parameter"); + } // GetAddrOfLocalVar returns a pointer-to-pointer for references, // but the argument needs to be the original pointer. |