]> granicus.if.org Git - clang/commitdiff
Avoid duplicate unavailbility diagnostics in objc++.
authorFariborz Jahanian <fjahanian@apple.com>
Sat, 15 Oct 2011 19:18:36 +0000 (19:18 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Sat, 15 Oct 2011 19:18:36 +0000 (19:18 +0000)
// rdar://10268422

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142078 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaExprObjC.cpp
test/SemaObjC/special-dep-unavail-warning.m

index 20098b21366d805350aa7180e2413eeb9221a559..a23ba4921c8640f2b9d6d1d6c5f2d678ec19403f 100644 (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()) {
index 57a2fa3465694b741417656ad76ad5c4e782e782..fb0f6604e6bf0673e6c09596e889f322430dea2a 100644 (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}}
+}
+