Avoid duplicate unavailbility diagnostics in objc++.

// rdar://10268422

llvm-svn: 142078
This commit is contained in:
Fariborz Jahanian 2011-10-15 19:18:36 +00:00
parent 3a46b375e2
commit c27cd1b881
2 changed files with 13 additions and 1 deletions

View File

@ -1078,7 +1078,9 @@ ExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo,
return ExprError();
}
assert(Class && "We don't know which class we're messaging?");
(void)DiagnoseUseOfDecl(Class, Loc);
// objc++ diagnoses during typename annotation.
if (!getLangOptions().CPlusPlus)
(void)DiagnoseUseOfDecl(Class, Loc);
// Find the method we are messaging.
if (!Method) {
if (Class->isForwardDecl()) {

View File

@ -43,3 +43,13 @@ void test(C *c) {
}
// rdar://10268422
__attribute ((deprecated))
@interface DEPRECATED
+(id)new;
@end
void foo() {
[DEPRECATED new]; // expected-warning {{warning: 'DEPRECATED' is deprecated}}
}