summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-01-29 02:42:22 +0000
committerSteve Naroff <snaroff@apple.com>2008-01-29 02:42:22 +0000
commit31daee11becf75fc76ac6fec9e4f3e260b677532 (patch)
tree9d55a9380b0ce8db8b5508b21db6d2a27cff9a81
parent5aa1615add8bc91e1fec7cc2ac7ab46589a5d4f2 (diff)
downloadbcm5719-llvm-31daee11becf75fc76ac6fec9e4f3e260b677532.tar.gz
bcm5719-llvm-31daee11becf75fc76ac6fec9e4f3e260b677532.zip
Tweak Sema::DefaultArgumentPromotion() to call UsualUnaryConversions(). This makes sure function calls that don't have a prototype get the default function/array conversion.
Patch by Eli Friedman! llvm-svn: 46489
-rw-r--r--clang/Sema/SemaExpr.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/clang/Sema/SemaExpr.cpp b/clang/Sema/SemaExpr.cpp
index 58e0f08e50d..ab63dc6993d 100644
--- a/clang/Sema/SemaExpr.cpp
+++ b/clang/Sema/SemaExpr.cpp
@@ -866,16 +866,16 @@ Action::ExprResult Sema::ActOnConditionalOp(SourceLocation QuestionLoc,
}
/// DefaultArgumentPromotion (C99 6.5.2.2p6). Used for function calls that
-/// do not have a prototype. Integer promotions are performed on each
-/// argument, and arguments that have type float are promoted to double.
+/// do not have a prototype. Arguments that have type float are promoted to
+/// double. All other argument types are converted by UsualUnaryConversions().
void Sema::DefaultArgumentPromotion(Expr *&Expr) {
QualType Ty = Expr->getType();
assert(!Ty.isNull() && "DefaultArgumentPromotion - missing type");
- if (Ty->isPromotableIntegerType()) // C99 6.3.1.1p2
- ImpCastExprToType(Expr, Context.IntTy);
if (Ty == Context.FloatTy)
ImpCastExprToType(Expr, Context.DoubleTy);
+ else
+ UsualUnaryConversions(Expr);
}
/// DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
OpenPOWER on IntegriCloud