aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-11-13 17:04:35 +0000
committerAnders Carlsson <andersca@mac.com>2009-11-13 17:04:35 +0000
commit4b3cbeaea60a1a2d1adc73738123c24549b7ce2c (patch)
tree228f6878aa8ed8f14970a7318ca3de7a6dd48fd2 /lib/Sema/SemaExpr.cpp
parente675049aa302bf07472ae6e76ff66e6f5427eff9 (diff)
Don't bind arguments to temporaries if the argument has a reference type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@88662 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r--lib/Sema/SemaExpr.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp
index 3663f0923d..f20b37d90c 100644
--- a/lib/Sema/SemaExpr.cpp
+++ b/lib/Sema/SemaExpr.cpp
@@ -2653,7 +2653,8 @@ Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn,
if (PerformCopyInitialization(Arg, ProtoArgType, "passing"))
return true;
- Arg = MaybeBindToTemporary(Arg).takeAs<Expr>();
+ if (!ProtoArgType->isReferenceType())
+ Arg = MaybeBindToTemporary(Arg).takeAs<Expr>();
} else {
ParmVarDecl *Param = FDecl->getParamDecl(i);