summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGCall.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2011-08-26 18:42:59 +0000
committerJohn McCall <rjmccall@apple.com>2011-08-26 18:42:59 +0000
commit0a76c0cf688861325a7cedf6ecb6ccbd30fb3f97 (patch)
tree4363d42742ba00027e3f28a74152281b5cee257d /clang/lib/CodeGen/CGCall.cpp
parent1cd60a2670f43053b2a70d8b7af63d86600a6415 (diff)
downloadbcm5719-llvm-0a76c0cf688861325a7cedf6ecb6ccbd30fb3f97.tar.gz
bcm5719-llvm-0a76c0cf688861325a7cedf6ecb6ccbd30fb3f97.zip
Assert that a call argument is a gl-value iff the parameter is a reference type.
llvm-svn: 138639
Diffstat (limited to 'clang/lib/CodeGen/CGCall.cpp')
-rw-r--r--clang/lib/CodeGen/CGCall.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/clang/lib/CodeGen/CGCall.cpp b/clang/lib/CodeGen/CGCall.cpp
index 846e1aa3934..102793b48ab 100644
--- a/clang/lib/CodeGen/CGCall.cpp
+++ b/clang/lib/CodeGen/CGCall.cpp
@@ -1431,6 +1431,9 @@ void CodeGenFunction::EmitCallArg(CallArgList &args, const Expr *E,
return emitWritebackArg(*this, args, CRE);
}
+ assert(type->isReferenceType() == E->isGLValue() &&
+ "reference binding to unmaterialized r-value!");
+
if (type->isReferenceType())
return args.add(EmitReferenceBindingToExpr(E, /*InitializedDecl=*/0),
type);
OpenPOWER on IntegriCloud