fix PR4021, array and functions decay in the receiver position of an objc message send.

llvm-svn: 70373
This commit is contained in:
Chris Lattner 2009-04-29 05:48:32 +00:00
parent 5f829d896d
commit 11a827471e
2 changed files with 16 additions and 2 deletions

View File

@ -461,8 +461,12 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
Expr *RExpr = static_cast<Expr *>(receiver);
// If necessary, apply function/array conversion to the receiver.
// C99 6.7.5.3p[7,8].
DefaultFunctionArrayConversion(RExpr);
QualType returnType;
QualType ReceiverCType =
Context.getCanonicalType(RExpr->getType()).getUnqualifiedType();

View File

@ -1,5 +1,10 @@
// RUN: clang-cc -fsyntax-only -verify %s
typedef struct objc_object {
Class isa;
} *id;
@interface foo
- (void)meth;
@end
@ -86,5 +91,10 @@ int test5(int X) {
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}
}
// PR4021
void foo4() {
struct objc_object X[10];
[X rect];
}