[cfe-commits] r142078 - in /cfe/trunk: lib/Sema/SemaExprObjC.cpp test/SemaObjC/special-dep-unavail-warning.m

Fariborz Jahanian fjahanian at apple.com
Sat Oct 15 12:18:36 PDT 2011


Author: fjahanian
Date: Sat Oct 15 14:18:36 2011
New Revision: 142078

URL: http://llvm.org/viewvc/llvm-project?rev=142078&view=rev
Log:
Avoid duplicate unavailbility diagnostics in objc++.
// rdar://10268422

Modified:
    cfe/trunk/lib/Sema/SemaExprObjC.cpp
    cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m

Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=142078&r1=142077&r2=142078&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Sat Oct 15 14:18:36 2011
@@ -1078,7 +1078,9 @@
     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()) {

Modified: cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m?rev=142078&r1=142077&r2=142078&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m (original)
+++ cfe/trunk/test/SemaObjC/special-dep-unavail-warning.m Sat Oct 15 14:18:36 2011
@@ -43,3 +43,13 @@
 
 }
 
+// rdar://10268422
+__attribute ((deprecated))
+ at interface DEPRECATED
++(id)new;
+ at end
+
+void foo() {
+  [DEPRECATED new]; // expected-warning {{warning: 'DEPRECATED' is deprecated}}
+}
+





More information about the cfe-commits mailing list