diff options
author | Daniel Dunbar <daniel@zuster.org> | 2008-09-11 00:04:36 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2008-09-11 00:04:36 +0000 |
commit | 6660c8a4cc2115929d92be83bbc54c307002a321 (patch) | |
tree | 05fb7dac2a55feaf5bd5e193a8816f9d361d5a12 /lib/Sema/SemaExprObjC.cpp | |
parent | 637cebb67c59765e1412c589550c8c9ba001baeb (diff) |
Bug fix, apply default argument promotion in message sends for which
no method declaration was found.
- This was allowing arrays to pass "by value" among other things.
Add assert in CodeGen that arguments cannot have array type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56080 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprObjC.cpp')
-rw-r--r-- | lib/Sema/SemaExprObjC.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprObjC.cpp b/lib/Sema/SemaExprObjC.cpp index 0d3bc29840..08177e6769 100644 --- a/lib/Sema/SemaExprObjC.cpp +++ b/lib/Sema/SemaExprObjC.cpp @@ -114,6 +114,10 @@ bool Sema::CheckMessageArgumentTypes(Expr **Args, Selector Sel, QualType &ReturnType) { unsigned NumArgs = Sel.getNumArgs(); if (!Method) { + // Apply default argument promotion as for (C99 6.5.2.2p6). + for (unsigned i = 0; i != NumArgs; i++) + DefaultArgumentPromotion(Args[i]); + Diag(lbrac, diag::warn_method_not_found, std::string(PrefixStr), Sel.getName(), SourceRange(lbrac, rbrac)); ReturnType = Context.getObjCIdType(); |