forked from OSchip/llvm-project
Diagnose miuse of property dot-syntax instead of crashing.
(radar 7634653). llvm-svn: 99210
This commit is contained in:
parent
e783d10bc0
commit
cf711fb353
|
@ -2332,6 +2332,7 @@ def warn_unused_call : Warning<
|
|||
|
||||
def err_incomplete_type_used_in_type_trait_expr : Error<
|
||||
"incomplete type %0 used in type trait expression">;
|
||||
def err_expected_ident_or_lparen : Error<"expected identifier or '('">;
|
||||
|
||||
// inline asm.
|
||||
def err_asm_wide_character : Error<"wide string is invalid in 'asm'">;
|
||||
|
|
|
@ -289,7 +289,10 @@ Action::OwningExprResult Sema::ActOnClassPropertyRefExpr(
|
|||
|
||||
IdentifierInfo *receiverNamePtr = &receiverName;
|
||||
ObjCInterfaceDecl *IFace = getObjCInterfaceDecl(receiverNamePtr);
|
||||
|
||||
if (!IFace) {
|
||||
Diag(receiverNameLoc, diag::err_expected_ident_or_lparen);
|
||||
return ExprError();
|
||||
}
|
||||
// Search for a declared property first.
|
||||
|
||||
Selector Sel = PP.getSelectorTable().getNullarySelector(&propertyName);
|
||||
|
|
|
@ -16,3 +16,8 @@ int main() {
|
|||
&object.index; // expected-error {{address of property expression requested}}
|
||||
return 0;
|
||||
}
|
||||
|
||||
typedef int Foo;
|
||||
void test() {
|
||||
Foo.x; // expected-error {{expected identifier or '('}}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue