forked from OSchip/llvm-project
fix PR4021, array and functions decay in the receiver position of an objc message send.
llvm-svn: 70373
This commit is contained in:
parent
5f829d896d
commit
11a827471e
|
@ -461,8 +461,12 @@ Sema::ExprResult Sema::ActOnInstanceMessage(ExprTy *receiver, Selector Sel,
|
||||||
|
|
||||||
Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
|
Expr **ArgExprs = reinterpret_cast<Expr **>(Args);
|
||||||
Expr *RExpr = static_cast<Expr *>(receiver);
|
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 returnType;
|
||||||
|
|
||||||
QualType ReceiverCType =
|
QualType ReceiverCType =
|
||||||
Context.getCanonicalType(RExpr->getType()).getUnqualifiedType();
|
Context.getCanonicalType(RExpr->getType()).getUnqualifiedType();
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,10 @@
|
||||||
// RUN: clang-cc -fsyntax-only -verify %s
|
// RUN: clang-cc -fsyntax-only -verify %s
|
||||||
|
|
||||||
|
typedef struct objc_object {
|
||||||
|
Class isa;
|
||||||
|
} *id;
|
||||||
|
|
||||||
|
|
||||||
@interface foo
|
@interface foo
|
||||||
- (void)meth;
|
- (void)meth;
|
||||||
@end
|
@end
|
||||||
|
@ -86,5 +91,10 @@ int test5(int X) {
|
||||||
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}
|
int b = [S somemsg]; // expected-error {{bad receiver type 'struct S'}}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// PR4021
|
||||||
|
void foo4() {
|
||||||
|
struct objc_object X[10];
|
||||||
|
|
||||||
|
[X rect];
|
||||||
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue