diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-27 20:29:39 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-06-27 20:29:39 +0000 |
commit | e1971a136a75e6722059d759d9700e411f63f344 (patch) | |
tree | 7a631f01d3f3e1674b3e4219d612438a18be6b7a /lib/Sema/SemaExpr.cpp | |
parent | 83ea530f9da1b8ca57773bf53418ce9fc98f46ac (diff) |
Refactoring after r159290: don't hold onto and check a misleading QualType.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159292 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExpr.cpp')
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index aec941c4c1..a6051d6ccc 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -649,8 +649,7 @@ bool Sema::variadicArgumentPODCheck(const Expr *E, VariadicCallType CT) { /// interfaces passed by value. ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, FunctionDecl *FDecl) { - const QualType &Ty = E->getType(); - if (const BuiltinType *PlaceholderTy = Ty->getAsPlaceholderType()) { + if (const BuiltinType *PlaceholderTy = E->getType()->getAsPlaceholderType()) { // Strip the unbridged-cast placeholder expression off, if applicable. if (PlaceholderTy->getKind() == BuiltinType::ARCUnbridgedCast && (CT == VariadicMethod || @@ -671,10 +670,10 @@ ExprResult Sema::DefaultVariadicArgumentPromotion(Expr *E, VariadicCallType CT, return ExprError(); E = ExprRes.take(); - if (Ty->isObjCObjectType() && + if (E->getType()->isObjCObjectType() && DiagRuntimeBehavior(E->getLocStart(), 0, PDiag(diag::err_cannot_pass_objc_interface_to_vararg) - << Ty << CT)) + << E->getType() << CT)) return ExprError(); // Diagnostics regarding non-POD argument types are |