summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprObjC.cpp
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2013-03-04 07:34:02 +0000
committerJohn McCall <rjmccall@apple.com>2013-03-04 07:34:02 +0000
commitcc5788c5ce474dc459b497bb7f4d3528c58a4367 (patch)
tree6e2104c166904545827f0689c65097051e6913de /clang/lib/Sema/SemaExprObjC.cpp
parenta37c2fa40966b75624a524913bddfc4ea669bb46 (diff)
downloadbcm5719-llvm-cc5788c5ce474dc459b497bb7f4d3528c58a4367.tar.gz
bcm5719-llvm-cc5788c5ce474dc459b497bb7f4d3528c58a4367.zip
Centralize and refine the __unknown_anytype argument rules
and be sure to apply them whether or not the debugger gave us a method declaration. rdar://12565338 llvm-svn: 176432
Diffstat (limited to 'clang/lib/Sema/SemaExprObjC.cpp')
-rw-r--r--clang/lib/Sema/SemaExprObjC.cpp27
1 files changed, 18 insertions, 9 deletions
diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp
index 74a32920542..75f8c48022a 100644
--- a/clang/lib/Sema/SemaExprObjC.cpp
+++ b/clang/lib/Sema/SemaExprObjC.cpp
@@ -1135,10 +1135,16 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
if (Args[i]->isTypeDependent())
continue;
- ExprResult Result = DefaultArgumentPromotion(Args[i]);
- if (Result.isInvalid())
+ ExprResult result;
+ if (getLangOpts().DebuggerSupport) {
+ QualType paramTy; // ignored
+ result = checkUnknownAnyArg(lbrac, Args[i], paramTy);
+ } else {
+ result = DefaultArgumentPromotion(Args[i]);
+ }
+ if (result.isInvalid())
return true;
- Args[i] = Result.take();
+ Args[i] = result.take();
}
unsigned DiagID;
@@ -1199,14 +1205,17 @@ bool Sema::CheckMessageArgumentTypes(QualType ReceiverType,
// If the parameter is __unknown_anytype, infer its type
// from the argument.
if (param->getType() == Context.UnknownAnyTy) {
- QualType paramType = checkUnknownAnyArg(argExpr);
- if (paramType.isNull()) {
+ QualType paramType;
+ ExprResult argE = checkUnknownAnyArg(lbrac, argExpr, paramType);
+ if (argE.isInvalid()) {
IsError = true;
- continue;
- }
+ } else {
+ Args[i] = argE.take();
- // Update the parameter type in-place.
- param->setType(paramType);
+ // Update the parameter type in-place.
+ param->setType(paramType);
+ }
+ continue;
}
if (RequireCompleteType(argExpr->getSourceRange().getBegin(),
OpenPOWER on IntegriCloud