diff options
author | Steve Naroff <snaroff@apple.com> | 2008-01-29 02:42:22 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-01-29 02:42:22 +0000 |
commit | b3c2b88de6121800590673d2a6294b1151cc2e02 (patch) | |
tree | 4c60fe211479b67faca42d330690b01fc31a080e | |
parent | ce6237edf61ce3e5b8686f303513412c43e69058 (diff) |
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!
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46489 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | Sema/SemaExpr.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Sema/SemaExpr.cpp b/Sema/SemaExpr.cpp index 58e0f08e50..ab63dc6993 100644 --- a/Sema/SemaExpr.cpp +++ b/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). |