]> granicus.if.org Git - clang/commitdiff
Implemented delayed processing of 'unavailable' checking, just like with 'deprecated'.
authorTed Kremenek <kremenek@apple.com>
Wed, 18 Dec 2013 23:30:06 +0000 (23:30 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 18 Dec 2013 23:30:06 +0000 (23:30 +0000)
Fixes <rdar://problem/15584219> and <rdar://problem/12241361>.

This change looks large, but all it does is reuse and consolidate
the delayed diagnostic logic for deprecation warnings with unavailability
warnings.  By doing so, it showed various inconsistencies between the
diagnostics, which were close, but not consistent.  It also revealed
some missing "note:"'s in the deprecated diagnostics that were showing
up in the unavailable diagnostics, etc.

This change also changes the wording of the core deprecation diagnostics.
Instead of saying "function has been explicitly marked deprecated"
we now saw "'X' has been been explicitly marked deprecated".  It
turns out providing a bit more context is useful, and often we
got the actual term wrong or it was not very precise
 (e.g., "function" instead of "destructor").  By just saying the name
of the thing that is deprecated/deleted/unavailable we define
this issue away.  This diagnostic can likely be further wordsmithed
to be shorter.

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

43 files changed:
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Sema/DelayedDiagnostic.h
include/clang/Sema/Sema.h
lib/Sema/DelayedDiagnostic.cpp
lib/Sema/SemaDeclAttr.cpp
lib/Sema/SemaExpr.cpp
test/ARCMT/checking.m
test/Analysis/retain-release.m
test/CXX/dcl.dcl/dcl.attr/dcl.attr.deprecated/p1.cpp
test/CXX/special/class.copy/p33-0x.cpp
test/CXX/special/class.inhctor/p4.cpp
test/CXX/special/class.temporary/p1.cpp
test/Headers/ms-intrin.cpp
test/Parser/MicrosoftExtensions.c
test/Sema/MicrosoftExtensions.c
test/Sema/attr-availability-ios.c
test/Sema/attr-availability-macosx.c
test/Sema/attr-availability.c
test/Sema/attr-cleanup.c
test/Sema/attr-deprecated-message.c
test/Sema/attr-deprecated.c
test/Sema/attr-unavailable-message.c
test/Sema/typeof-use-deprecated.c
test/SemaCXX/aggregate-initialization.cpp
test/SemaCXX/attr-deprecated.cpp
test/SemaCXX/attr-unavailable.cpp
test/SemaCXX/cxx0x-delegating-ctors.cpp
test/SemaCXX/deleted-function.cpp
test/SemaCXX/for-range-dereference.cpp
test/SemaCXX/microsoft-dtor-lookup-cxx11.cpp
test/SemaCXX/rval-references-examples.cpp
test/SemaObjC/arc-unavailable-system-function.m
test/SemaObjC/attr-availability.m
test/SemaObjC/attr-deprecated.m
test/SemaObjC/class-unavail-warning.m
test/SemaObjC/property-deprecated-warning.m
test/SemaObjC/property-noninherited-availability-attr.m
test/SemaObjC/protocol-attribute.m
test/SemaObjC/special-dep-unavail-warning.m
test/SemaObjC/warn-deprecated-implementations.m
test/SemaObjC/warn-forward-class-attr-deprecated.m
test/SemaObjC/warn-protocol-method-deprecated.m
test/SemaObjCXX/arc-system-header.mm

index fc7a0082ff7478dfaebb7dd6a1b384782631ccfb..91a19aaf8825a1bb308d61abf86d8e7521452a27 100644 (file)
@@ -3527,8 +3527,8 @@ def err_unavailable : Error<"%0 is unavailable">;
 def err_unavailable_message : Error<"%0 is unavailable: %1">;
 def warn_unavailable_fwdclass_message : Warning<
     "%0 maybe unavailable because receiver type is unknown">;
-def note_unavailable_here : Note<
-  "%select{declaration|function}0 has been explicitly marked "
+def note_availability_specified_here : Note<
+  "%0 has been explicitly marked "
   "%select{unavailable|deleted|deprecated}1 here">;
 def note_implicitly_deleted : Note<
   "explicitly defaulted function was implicitly deleted here">;
index 4f4a87fe11f2d312988dd954b7da6ac489647c95..0a3b9f59261fc8c6bd45ebb105f658ddc26bdf82 100644 (file)
@@ -113,7 +113,7 @@ private:
 /// the complete parsing of the current declaration.
 class DelayedDiagnostic {
 public:
-  enum DDKind { Deprecation, Access, ForbiddenType };
+  enum DDKind { Deprecation, Unavailable, Access, ForbiddenType };
 
   unsigned char Kind; // actually a DDKind
   bool Triggered;
@@ -122,11 +122,13 @@ public:
 
   void Destroy();
 
-  static DelayedDiagnostic makeDeprecation(SourceLocation Loc,
-           const NamedDecl *D,
-           const ObjCInterfaceDecl *UnknownObjCClass,
-           const ObjCPropertyDecl  *ObjCProperty,
-           StringRef Msg);
+  static DelayedDiagnostic makeAvailability(Sema::AvailabilityDiagnostic AD,
+                                            SourceLocation Loc,
+                                            const NamedDecl *D,
+                                            const ObjCInterfaceDecl *UnknownObjCClass,
+                                            const ObjCPropertyDecl  *ObjCProperty,
+                                            StringRef Msg);
+
 
   static DelayedDiagnostic makeAccess(SourceLocation Loc,
                                       const AccessedEntity &Entity) {
@@ -162,12 +164,14 @@ public:
   }
 
   const NamedDecl *getDeprecationDecl() const {
-    assert(Kind == Deprecation && "Not a deprecation diagnostic.");
+    assert((Kind == Deprecation || Kind == Unavailable) &&
+           "Not a deprecation diagnostic.");
     return DeprecationData.Decl;
   }
 
   StringRef getDeprecationMessage() const {
-    assert(Kind == Deprecation && "Not a deprecation diagnostic.");
+    assert((Kind == Deprecation || Kind == Unavailable) &&
+           "Not a deprecation diagnostic.");
     return StringRef(DeprecationData.Message,
                            DeprecationData.MessageLen);
   }
index 75e1a341ed4381868d5c751275c8f882ee4f8441..8533972d4fe34fb61119325d44b1f29ff9e2ca0b 100644 (file)
@@ -3083,12 +3083,15 @@ public:
 
   void redelayDiagnostics(sema::DelayedDiagnosticPool &pool);
 
-  void EmitDeprecationWarning(NamedDecl *D, StringRef Message,
-                              SourceLocation Loc,
-                              const ObjCInterfaceDecl *UnknownObjCClass,
-                              const ObjCPropertyDecl  *ObjCProperty);
+  enum AvailabilityDiagnostic { AD_Deprecation, AD_Unavailable };
+
+  void EmitAvailabilityWarning(AvailabilityDiagnostic AD,
+                               NamedDecl *D, StringRef Message,
+                               SourceLocation Loc,
+                               const ObjCInterfaceDecl *UnknownObjCClass,
+                               const ObjCPropertyDecl  *ObjCProperty);
 
-  void HandleDelayedDeprecationCheck(sema::DelayedDiagnostic &DD, Decl *Ctx);
+  void HandleDelayedAvailabilityCheck(sema::DelayedDiagnostic &DD, Decl *Ctx);
 
   bool makeUnavailableInSystemHeader(SourceLocation loc,
                                      StringRef message);
index 31004328855407e33c4353c6d574756f34527a25..533b7ef3e87d0e3e0fd40537d4ba4575570eb849 100644 (file)
 using namespace clang;
 using namespace sema;
 
-DelayedDiagnostic DelayedDiagnostic::makeDeprecation(SourceLocation Loc,
+DelayedDiagnostic
+DelayedDiagnostic::makeAvailability(Sema::AvailabilityDiagnostic AD,
+                                    SourceLocation Loc,
                                     const NamedDecl *D,
                                     const ObjCInterfaceDecl *UnknownObjCClass,
                                     const ObjCPropertyDecl  *ObjCProperty,
                                     StringRef Msg) {
   DelayedDiagnostic DD;
-  DD.Kind = Deprecation;
+  switch (AD) {
+    case Sema::AD_Deprecation:
+      DD.Kind = Deprecation;
+      break;
+    case Sema::AD_Unavailable:
+      DD.Kind = Unavailable;
+      break;
+  }
   DD.Triggered = false;
   DD.Loc = Loc;
   DD.DeprecationData.Decl = D;
index 5e9bd2cf49b12b0be29fb0e1fa7224c4e7b588a4..b44506c0a3f890b61a288b723e03b890ce87357f 100644 (file)
@@ -4477,9 +4477,11 @@ void Sema::PopParsingDeclaration(ParsingDeclState state, Decl *decl) {
 
       switch (diag.Kind) {
       case DelayedDiagnostic::Deprecation:
-        // Don't bother giving deprecation diagnostics if the decl is invalid.
+      case DelayedDiagnostic::Unavailable:
+        // Don't bother giving deprecation/unavailable diagnostics if
+        // the decl is invalid.
         if (!decl->isInvalidDecl())
-          HandleDelayedDeprecationCheck(diag, decl);
+          HandleDelayedAvailabilityCheck(diag, decl);
         break;
 
       case DelayedDiagnostic::Access:
@@ -4514,61 +4516,124 @@ static bool isDeclDeprecated(Decl *D) {
   return false;
 }
 
+static bool isDeclUnavailable(Decl *D) {
+  do {
+    if (D->isUnavailable())
+      return true;
+    // A category implicitly has the availability of the interface.
+    if (const ObjCCategoryDecl *CatD = dyn_cast<ObjCCategoryDecl>(D))
+      return CatD->getClassInterface()->isUnavailable();
+  } while ((D = cast_or_null<Decl>(D->getDeclContext())));
+  return false;
+}
+
 static void
-DoEmitDeprecationWarning(Sema &S, const NamedDecl *D, StringRef Message,
-                         SourceLocation Loc,
-                         const ObjCInterfaceDecl *UnknownObjCClass,
-                         const ObjCPropertyDecl *ObjCPropery) {
+DoEmitAvailabilityWarning(Sema &S,
+                          DelayedDiagnostic::DDKind K,
+                          Decl *Ctx,
+                          const NamedDecl *D,
+                          StringRef Message,
+                          SourceLocation Loc,
+                          const ObjCInterfaceDecl *UnknownObjCClass,
+                          const ObjCPropertyDecl *ObjCProperty) {
+
+  // Diagnostics for deprecated or unavailable.
+  unsigned diag, diag_message, diag_fwdclass_message;
+
+  // Matches 'diag::note_property_attribute' options.
+  unsigned property_note_select;
+
+  // Matches diag::note_availability_specified_here.
+  unsigned available_here_select_kind;
+
+  // Don't warn if our current context is deprecated or unavailable.
+  switch (K) {
+    case DelayedDiagnostic::Deprecation:
+      if (isDeclDeprecated(Ctx))
+        return;
+      diag = diag::warn_deprecated;
+      diag_message = diag::warn_deprecated_message;
+      diag_fwdclass_message = diag::warn_deprecated_fwdclass_message;
+      property_note_select = /* deprecated */ 0;
+      available_here_select_kind = /* deprecated */ 2;
+      break;
+
+    case DelayedDiagnostic::Unavailable:
+      if (isDeclUnavailable(Ctx))
+        return;
+      diag = diag::err_unavailable;
+      diag_message = diag::err_unavailable_message;
+      diag_fwdclass_message = diag::warn_unavailable_fwdclass_message;
+      property_note_select = /* unavailable */ 1;
+      available_here_select_kind = /* unavailable */ 0;
+      break;
+
+    default:
+      llvm_unreachable("Neither a deprecation or unavailable kind");
+  }
+
   DeclarationName Name = D->getDeclName();
   if (!Message.empty()) {
-    S.Diag(Loc, diag::warn_deprecated_message) << Name << Message;
-    S.Diag(D->getLocation(),
-           isa<ObjCMethodDecl>(D) ? diag::note_method_declared_at
-                                  : diag::note_previous_decl) << Name;
-    if (ObjCPropery)
-      S.Diag(ObjCPropery->getLocation(), diag::note_property_attribute)
-        << ObjCPropery->getDeclName() << 0;
+    S.Diag(Loc, diag_message) << Name << Message;
+//    S.Diag(D->getLocation(), diag::note_availability_specified_here)
+//      << D << available_here_select_kind;
+    if (ObjCProperty)
+      S.Diag(ObjCProperty->getLocation(), diag::note_property_attribute)
+        << ObjCProperty->getDeclName() << property_note_select;
   } else if (!UnknownObjCClass) {
-    S.Diag(Loc, diag::warn_deprecated) << D->getDeclName();
-    S.Diag(D->getLocation(),
-           isa<ObjCMethodDecl>(D) ? diag::note_method_declared_at
-                                  : diag::note_previous_decl) << Name;
-    if (ObjCPropery)
-      S.Diag(ObjCPropery->getLocation(), diag::note_property_attribute)
-        << ObjCPropery->getDeclName() << 0;
+    S.Diag(Loc, diag) << Name;
+//    S.Diag(D->getLocation(), diag::note_availability_specified_here)
+//      << D << available_here_select_kind;
+    if (ObjCProperty)
+      S.Diag(ObjCProperty->getLocation(), diag::note_property_attribute)
+        << ObjCProperty->getDeclName() << property_note_select;
   } else {
-    S.Diag(Loc, diag::warn_deprecated_fwdclass_message) << Name;
+    S.Diag(Loc, diag_fwdclass_message) << Name;
     S.Diag(UnknownObjCClass->getLocation(), diag::note_forward_class);
   }
-}
-
-void Sema::HandleDelayedDeprecationCheck(DelayedDiagnostic &DD,
-                                         Decl *Ctx) {
-  if (isDeclDeprecated(Ctx))
-    return;
 
-  DD.Triggered = true;
-  DoEmitDeprecationWarning(*this, DD.getDeprecationDecl(),
-                           DD.getDeprecationMessage(), DD.Loc,
-                           DD.getUnknownObjCClass(),
-                           DD.getObjCProperty());
+  S.Diag(D->getLocation(), diag::note_availability_specified_here)
+    << D << available_here_select_kind;
 }
 
-void Sema::EmitDeprecationWarning(NamedDecl *D, StringRef Message,
-                                  SourceLocation Loc,
-                                  const ObjCInterfaceDecl *UnknownObjCClass,
-                                  const ObjCPropertyDecl  *ObjCProperty) {
+void Sema::HandleDelayedAvailabilityCheck(DelayedDiagnostic &DD,
+                                          Decl *Ctx) {
+  DD.Triggered = true;
+  DoEmitAvailabilityWarning(*this,
+                            (DelayedDiagnostic::DDKind) DD.Kind,
+                            Ctx,
+                            DD.getDeprecationDecl(),
+                            DD.getDeprecationMessage(),
+                            DD.Loc,
+                            DD.getUnknownObjCClass(),
+                            DD.getObjCProperty());
+}
+
+void Sema::EmitAvailabilityWarning(AvailabilityDiagnostic AD,
+                                   NamedDecl *D, StringRef Message,
+                                   SourceLocation Loc,
+                                   const ObjCInterfaceDecl *UnknownObjCClass,
+                                   const ObjCPropertyDecl  *ObjCProperty) {
   // Delay if we're currently parsing a declaration.
   if (DelayedDiagnostics.shouldDelayDiagnostics()) {
-    DelayedDiagnostics.add(DelayedDiagnostic::makeDeprecation(Loc, D, 
-                                                              UnknownObjCClass,
-                                                              ObjCProperty,
-                                                              Message));
+    DelayedDiagnostics.add(DelayedDiagnostic::makeAvailability(AD, Loc, D,
+                                                               UnknownObjCClass,
+                                                               ObjCProperty,
+                                                               Message));
     return;
   }
 
-  // Otherwise, don't warn if our current context is deprecated.
-  if (isDeclDeprecated(cast<Decl>(getCurLexicalContext())))
-    return;
-  DoEmitDeprecationWarning(*this, D, Message, Loc, UnknownObjCClass, ObjCProperty);
+  Decl *Ctx = cast<Decl>(getCurLexicalContext());
+  DelayedDiagnostic::DDKind K;
+  switch (AD) {
+    case AD_Deprecation:
+      K = DelayedDiagnostic::Deprecation;
+      break;
+    case AD_Unavailable:
+      K = DelayedDiagnostic::Unavailable;
+      break;
+  }
+
+  DoEmitAvailabilityWarning(*this, K, Ctx, D, Message, Loc,
+                            UnknownObjCClass, ObjCProperty);
 }
index a1de4046e0fffc1d891814bba9c4088416aa95f7..3bc221fb7ee66042df89e844af3e7a59f8ba40b2 100644 (file)
@@ -112,32 +112,16 @@ static AvailabilityResult DiagnoseAvailabilityOfDecl(Sema &S,
             
     case AR_Deprecated:
       if (S.getCurContextAvailability() != AR_Deprecated)
-        S.EmitDeprecationWarning(D, Message, Loc, UnknownObjCClass, ObjCPDecl);
+        S.EmitAvailabilityWarning(Sema::AD_Deprecation,
+                                  D, Message, Loc, UnknownObjCClass, ObjCPDecl);
       break;
-            
+
     case AR_Unavailable:
-      if (S.getCurContextAvailability() != AR_Unavailable) {
-        if (Message.empty()) {
-          if (!UnknownObjCClass) {
-            S.Diag(Loc, diag::err_unavailable) << D->getDeclName();
-            if (ObjCPDecl)
-              S.Diag(ObjCPDecl->getLocation(), diag::note_property_attribute)
-                << ObjCPDecl->getDeclName() << 1;
-          }
-          else
-            S.Diag(Loc, diag::warn_unavailable_fwdclass_message) 
-              << D->getDeclName();
-        }
-        else
-          S.Diag(Loc, diag::err_unavailable_message) 
-            << D->getDeclName() << Message;
-        S.Diag(D->getLocation(), diag::note_unavailable_here)
-                  << isa<FunctionDecl>(D) << false;
-        if (ObjCPDecl)
-          S.Diag(ObjCPDecl->getLocation(), diag::note_property_attribute)
-          << ObjCPDecl->getDeclName() << 1;
-      }
+      if (S.getCurContextAvailability() != AR_Unavailable)
+        S.EmitAvailabilityWarning(Sema::AD_Unavailable,
+                                  D, Message, Loc, UnknownObjCClass, ObjCPDecl);
       break;
+
     }
     return Result;
 }
@@ -177,8 +161,8 @@ void Sema::NoteDeletedFunction(FunctionDecl *Decl) {
     }
   }
 
-  Diag(Decl->getLocation(), diag::note_unavailable_here)
-    << 1 << true;
+  Diag(Decl->getLocation(), diag::note_availability_specified_here)
+    << Decl << true;
 }
 
 /// \brief Determine whether a FunctionDecl was ever declared with an
index a640c2f40237360677a6c0664a2b0db8bfaa3333..7815103822a12940d2ec843a45e1259b2a8b0335 100644 (file)
@@ -44,9 +44,9 @@ struct UnsafeS {
 };
 
 @interface A : NSObject
-- (id)retain; // expected-note {{declaration has been explicitly marked unavailable here}}
-- (id)retainCount; // expected-note {{declaration has been explicitly marked unavailable here}}
-- (id)autorelease; // expected-note 2 {{declaration has been explicitly marked unavailable here}}
+- (id)retain; // expected-note {{'retain' has been explicitly marked unavailable here}}
+- (id)retainCount; // expected-note {{'retainCount' has been explicitly marked unavailable here}}
+- (id)autorelease; // expected-note 2 {{'autorelease' has been explicitly marked unavailable here}}
 - (id)init;
 - (oneway void)release;
 - (void)dealloc;
index 57d3203be1293c6cf024aaec89efbea27ddd1cd4..8b11a56799c347d96610a572a3edd129def86a58 100644 (file)
@@ -210,7 +210,7 @@ typedef struct IONotificationPort * IONotificationPortRef;
 typedef void (*IOServiceMatchingCallback)(  void * refcon,  io_iterator_t iterator );
 io_service_t IOServiceGetMatchingService(  mach_port_t masterPort,  CFDictionaryRef matching );
 kern_return_t IOServiceGetMatchingServices(  mach_port_t masterPort,  CFDictionaryRef matching,  io_iterator_t * existing );
-kern_return_t IOServiceAddNotification(  mach_port_t masterPort,  const io_name_t notificationType,  CFDictionaryRef matching,  mach_port_t wakePort,  uintptr_t reference,  io_iterator_t * notification ) __attribute__((deprecated)); // expected-note {{'IOServiceAddNotification' declared here}}
+kern_return_t IOServiceAddNotification(  mach_port_t masterPort,  const io_name_t notificationType,  CFDictionaryRef matching,  mach_port_t wakePort,  uintptr_t reference,  io_iterator_t * notification ) __attribute__((deprecated)); // expected-note {{'IOServiceAddNotification' has been explicitly marked deprecated here}}
 kern_return_t IOServiceAddMatchingNotification(  IONotificationPortRef notifyPort,  const io_name_t notificationType,  CFDictionaryRef matching,         IOServiceMatchingCallback callback,         void * refCon,  io_iterator_t * notification );
 CFMutableDictionaryRef IOServiceMatching(  const char * name );
 CFMutableDictionaryRef IOServiceNameMatching(  const char * name );
index 21119398b2f4fc8aa7d4303139abd91ce396996e..3bbbf9eed6e4f4bc5cef3240f766e9ca854ce7a4 100644 (file)
@@ -1,25 +1,25 @@
 // RUN: %clang_cc1 -std=c++1y -verify %s
 
-class [[deprecated]] C {}; // expected-note {{declared here}}
+class [[deprecated]] C {}; // expected-note {{'C' has been explicitly marked deprecated here}}
 C c; // expected-warning {{'C' is deprecated}}
 
-typedef int t [[deprecated]]; // expected-note {{declared here}}
+typedef int t [[deprecated]]; // expected-note {{'t' has been explicitly marked deprecated here}}
 t x = 42; // expected-warning {{'t' is deprecated}}
 
-[[deprecated]] int old = 42; // expected-note {{declared here}}
+[[deprecated]] int old = 42; // expected-note {{'old' has been explicitly marked deprecated here}}
 int use = old; // expected-warning {{'old' is deprecated}}
 
-struct S { [[deprecated]] int member = 42; } s; // expected-note {{declared here}}
+struct S { [[deprecated]] int member = 42; } s; // expected-note {{'member' has been explicitly marked deprecated here}}
 int use2 = s.member; // expected-warning {{'member' is deprecated}}
 
-[[deprecated]] int f() { return 42; } // expected-note {{declared here}}
+[[deprecated]] int f() { return 42; } // expected-note {{'f' has been explicitly marked deprecated here}}
 int use3 = f(); // expected-warning {{'f' is deprecated}}
 
-enum [[deprecated]] e { E }; // expected-note {{declared here}}
+enum [[deprecated]] e { E }; // expected-note {{'e' has been explicitly marked deprecated here}}
 e my_enum; // expected-warning {{'e' is deprecated}}
 
 template <typename T> class X {};
-template <> class [[deprecated]] X<int> {}; // expected-note {{declared here}}
+template <> class [[deprecated]] X<int> {}; // expected-note {{'X<int>' has been explicitly marked deprecated here}}
 X<char> x1;
 // FIXME: The diagnostic here could be much better by mentioning X<int>.
 X<int> x2; // expected-warning {{'X' is deprecated}}
index b66e19ab4c4f922c5f115fe3b5ccfc7c2b13e0f9..28cd4f33a8aa6310e4434847fe9e8fed7b837a65 100644 (file)
@@ -27,7 +27,7 @@ namespace PR10142 {
   struct X {
     X();
     X(X&&);
-    X(const X&) = delete; // expected-note 2{{function has been explicitly marked deleted here}}
+    X(const X&) = delete; // expected-note 2{{'X' has been explicitly marked deleted here}}
   };
 
   void f(int i) {
index 356cdef687fb82afeccd2f83756d1e09ee50e648..ae1f7a57031f1a4acc2d222fb92e19ae260ff323 100644 (file)
@@ -43,8 +43,8 @@ FA fa2{X<2>{}}; // expected-error {{calling a private constructor}}
 
 // It is deleted if the corresponding constructor [...] is deleted.
 struct G {
-  G(int) = delete; // expected-note {{function has been explicitly marked deleted here}}
-  template<typename T> G(T*) = delete; // expected-note {{function has been explicitly marked deleted here}}
+  G(int) = delete; // expected-note {{'G' has been explicitly marked deleted here}}
+  template<typename T> G(T*) = delete; // expected-note {{'G<const char>' has been explicitly marked deleted here}}
 };
 struct H : G {
   using G::G; // expected-note 2{{deleted constructor was inherited here}}
index 4f6ac0a0029ed514addd35da8789ae1b3ce22c6b..75a56df1e9c3289b543ac0ee9f3991dbf8f576ed 100644 (file)
@@ -6,7 +6,7 @@ namespace test0 {
     int x;
     int y;
 
-    A(const A&) = delete; // expected-note {{function has been explicitly marked deleted here}}
+    A(const A&) = delete; // expected-note {{'A' has been explicitly marked deleted here}}
   };
 
   void foo(...);
index 1bf134e7eac6f66b32ac4c7e3ae866bc06198df2..6a6c23235563cc9ff07d4bd18c3cb4bf4b192451 100644 (file)
@@ -18,7 +18,7 @@ void bar() {
   _WriteBarrier();      // expected-warning {{is deprecated: use other intrinsics or C++11 atomics instead}}
   // FIXME: It'd be handy if we didn't have to hardcode the line number in
   // intrin.h.
-  // expected-note@Intrin.h:754 {{declared here}}
-  // expected-note@Intrin.h:759 {{declared here}}
-  // expected-note@Intrin.h:764 {{declared here}}
+  // expected-note@Intrin.h:754 {{'_ReadWriteBarrier' has been explicitly marked deprecated here}}
+  // expected-note@Intrin.h:759 {{'_ReadBarrier' has been explicitly marked deprecated here}}
+  // expected-note@Intrin.h:764 {{'_WriteBarrier' has been explicitly marked deprecated here}}
 }
index 5e1139338b81c8c95672eaae67b11a5329b0d134..f61f7b45f1eed981fd38797b0430014b954c3161 100644 (file)
@@ -71,8 +71,8 @@ char x = FOO(a);
 typedef enum E { e1 };
 
 
-enum __declspec(deprecated) E2 { i, j, k }; // expected-note {{declared here}}
-__declspec(deprecated) enum E3 { a, b, c } e; // expected-note {{declared here}}
+enum __declspec(deprecated) E2 { i, j, k }; // expected-note {{'E2' has been explicitly marked deprecated here}}
+__declspec(deprecated) enum E3 { a, b, c } e; // expected-note {{'e' has been explicitly marked deprecated here}}
 
 void deprecated_enum_test(void)
 {
@@ -111,7 +111,7 @@ struct __declspec(unknown(12) deprecated) S6 {};    /* expected-warning {{unknown _
 
 struct S7 {
        int foo() { return 12; }
-       __declspec(property(get=foo) deprecated) int t; // expected-note {{declared here}}
+       __declspec(property(get=foo) deprecated) int t; // expected-note {{'t' has been explicitly marked deprecated here}}
 };
 
 /* Technically, this is legal (though it does nothing) */
index e672d05d0902cc3706c63dbf3b0b431845e57a43..4441f179736359a0ca2dc28a390b931b9b1fd873 100644 (file)
@@ -87,11 +87,11 @@ typedef struct {
   AA; // expected-warning {{anonymous structs are a Microsoft extension}}
 } BB;
 
-__declspec(deprecated("This is deprecated")) enum DE1 { one, two } e1; // expected-note {{'e1' declared here}}
-struct __declspec(deprecated) DS1 { int i; float f; }; // expected-note {{declared here}}
+__declspec(deprecated("This is deprecated")) enum DE1 { one, two } e1; // expected-note {{'e1' has been explicitly marked deprecated here}}
+struct __declspec(deprecated) DS1 { int i; float f; }; // expected-note {{'DS1' has been explicitly marked deprecated here}}
 
 #define MY_TEXT                "This is also deprecated"
-__declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {} // expected-note {{'Dfunc1' declared here}}
+__declspec(deprecated(MY_TEXT)) void Dfunc1( void ) {} // expected-note {{'Dfunc1' has been explicitly marked deprecated here}}
 
 struct __declspec(deprecated(123)) DS2 {};     // expected-error {{'deprecated' attribute requires a string}}
 
index 329068cf16bb46632e2ccb3b4da9aeea83edddf3..6462d58beec0d4e602a4518e1933b48412f98ad9 100644 (file)
@@ -1,14 +1,14 @@
 // RUN: %clang_cc1 "-triple" "x86_64-apple-ios3.0" -fsyntax-only -verify %s
 
-void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); // expected-note {{'f0' declared here}}
+void f0(int) __attribute__((availability(ios,introduced=2.0,deprecated=2.1))); // expected-note {{'f0' has been explicitly marked deprecated here}}
 void f1(int) __attribute__((availability(ios,introduced=2.1)));
-void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'f2' declared here}}
+void f2(int) __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'f2' has been explicitly marked deprecated here}}
 void f3(int) __attribute__((availability(ios,introduced=3.0)));
 void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=2.1,obsoleted=3.0))); // expected-note{{explicitly marked unavailable}}
 
-void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); // expected-note {{'f5' declared here}}
+void f5(int) __attribute__((availability(ios,introduced=2.0))) __attribute__((availability(ios,deprecated=3.0))); // expected-note {{'f5' has been explicitly marked deprecated here}}
 void f6(int) __attribute__((availability(ios,deprecated=3.0)));
-void f6(int) __attribute__((availability(ios,introduced=2.0))); // expected-note {{'f6' declared here}}
+void f6(int) __attribute__((availability(ios,introduced=2.0))); // expected-note {{'f6' has been explicitly marked deprecated here}}
 
 void test() {
   f0(0); // expected-warning{{'f0' is deprecated: first deprecated in iOS 2.1}}
index 468e9303e70d2627e3cf92f441632104256ee55c..38f149ba62aed15ebc31d21d9b050340e6ac6ca2 100644 (file)
@@ -2,10 +2,10 @@
 
 void f0(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.6)));
 void f1(int) __attribute__((availability(macosx,introduced=10.5)));
-void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5))); // expected-note {{'f2' declared here}}
+void f2(int) __attribute__((availability(macosx,introduced=10.4,deprecated=10.5))); // expected-note {{'f2' has been explicitly marked deprecated here}}
 void f3(int) __attribute__((availability(macosx,introduced=10.6)));
 void f4(int) __attribute__((availability(macosx,introduced=10.1,deprecated=10.3,obsoleted=10.5), availability(ios,introduced=2.0,deprecated=3.0))); // expected-note{{explicitly marked unavailable}}
-void f5(int) __attribute__((availability(ios,introduced=3.2), availability(macosx,unavailable))); // expected-note{{function has been explicitly marked unavailable here}}
+void f5(int) __attribute__((availability(ios,introduced=3.2), availability(macosx,unavailable))); // expected-note{{'f5' has been explicitly marked unavailable here}}
 
 void test() {
   f0(0);
index ac6a187591b07be1e8f9b8d1f5bb99a6cc46f4e6..b7a8e6ef0f59acf6e57da0592bbf596e7e290da2 100644 (file)
@@ -8,10 +8,10 @@ void f3() __attribute__((availability(otheros,introduced=2.2))); // expected-war
 
 // rdar://10095131
 extern void 
-ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); // expected-note {{'ATSFontGetName' declared here}}
+ATSFontGetName(const char *oName) __attribute__((availability(macosx,introduced=8.0,deprecated=9.0, message="use CTFontCopyFullName"))); // expected-note {{'ATSFontGetName' has been explicitly marked deprecated here}}
 
 extern void
-ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{function has been explicitly marked unavailable here}}
+ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{'ATSFontGetPostScriptName' has been explicitly marked unavailable here}}
 
 void test_10095131() {
   ATSFontGetName("Hello"); // expected-warning {{'ATSFontGetName' is deprecated: first deprecated in OS X 9.0 - use CTFontCopyFullName}}
index f5cbc385c6897c44c81ea78ecefbbdc7e385a313..26f283a1a4fa6d0d345425a564941f5b1e19e53f 100644 (file)
@@ -38,7 +38,7 @@ void t4() {
   __attribute((cleanup(c4))) void* g;
 }
 
-void c5(void*) __attribute__((deprecated));  // expected-note{{'c5' declared here}}
+void c5(void*) __attribute__((deprecated));  // expected-note{{'c5' has been explicitly marked deprecated here}}
 void t5() {
   int i __attribute__((cleanup(c5)));  // expected-warning {{'c5' is deprecated}}
 }
index f48d13e607dd732e90d68135d9bc10a0f7e563e8..c68306132c3e6377998567b13439956515f5ee28 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 %s -verify -fsyntax-only
 // rdar: // 6734520
 
-typedef int INT1 __attribute__((deprecated("Please avoid INT1"))); // expected-note 3 {{'INT1' declared here}}
+typedef int INT1 __attribute__((deprecated("Please avoid INT1"))); // expected-note 3 {{'INT1' has been explicitly marked deprecated here}}
 
 typedef INT1 INT2 __attribute__ ((__deprecated__("Please avoid INT2")));
 
@@ -12,16 +12,16 @@ typedef INT1 INT1b __attribute__ ((deprecated("Please avoid INT1b")));
 INT1 should_be_unavailable; // expected-warning {{'INT1' is deprecated: Please avoid INT1}}
 INT1a should_not_be_deprecated;
 
-INT1 f1(void) __attribute__ ((deprecated("Please avoid f1"))); // expected-note {{'f1' declared here}}
+INT1 f1(void) __attribute__ ((deprecated("Please avoid f1"))); // expected-note {{'f1' has been explicitly marked deprecated here}}
 INT1 f2(void); // expected-warning {{'INT1' is deprecated: Please avoid INT1}}
 
-typedef enum {red, green, blue} Color __attribute__((deprecated("Please avoid Color"))); // expected-note {{'Color' declared here}}
+typedef enum {red, green, blue} Color __attribute__((deprecated("Please avoid Color"))); // expected-note {{'Color' has been explicitly marked deprecated here}}
  
 
 Color c1; // expected-warning {{'Color' is deprecated: Please avoid Color}}
 
 int g1;
-int g2 __attribute__ ((deprecated("Please avoid g2"))); // expected-note {{'g2' declared here}}
+int g2 __attribute__ ((deprecated("Please avoid g2"))); // expected-note {{'g2' has been explicitly marked deprecated here}}
 
 int func1()
 {
index 8124ab0ddd02f0021189e4dd925dc3c7761466b4..c9e3dd546c581f13597a0a1bc6da0f9ea7c96e79 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 %s -verify -fsyntax-only
 
-int f() __attribute__((deprecated)); // expected-note 2 {{declared here}}
+int f() __attribute__((deprecated)); // expected-note 2 {{'f' has been explicitly marked deprecated here}}
 void g() __attribute__((deprecated));
-void g(); // expected-note {{declared here}}
+void g(); // expected-note {{'g' has been explicitly marked deprecated here}}
 
-extern int var __attribute__((deprecated)); // expected-note {{declared here}}
+extern int var __attribute__((deprecated)); // expected-note {{'var' has been explicitly marked deprecated here}}
 
 int a() {
   int (*ptr)() = f; // expected-warning {{'f' is deprecated}}
@@ -17,13 +17,13 @@ int a() {
 }
 
 // test if attributes propagate to variables
-extern int var; // expected-note {{declared here}}
+extern int var; // expected-note {{'var' has been explicitly marked deprecated here}}
 int w() {
   return var; // expected-warning {{'var' is deprecated}}
 }
 
 int old_fn() __attribute__ ((deprecated));
-int old_fn(); // expected-note {{declared here}}
+int old_fn(); // expected-note {{'old_fn' has been explicitly marked deprecated here}}
 int (*fn_ptr)() = old_fn; // expected-warning {{'old_fn' is deprecated}}
 
 int old_fn() {
@@ -32,7 +32,7 @@ int old_fn() {
 
 
 struct foo {
-  int x __attribute__((deprecated)); // expected-note 3 {{declared here}}
+  int x __attribute__((deprecated)); // expected-note 3 {{'x' has been explicitly marked deprecated here}}
 };
 
 void test1(struct foo *F) {
@@ -41,11 +41,11 @@ void test1(struct foo *F) {
   struct foo f2 = { 17 }; // expected-warning {{'x' is deprecated}}
 }
 
-typedef struct foo foo_dep __attribute__((deprecated)); // expected-note 12 {{declared here}}
+typedef struct foo foo_dep __attribute__((deprecated)); // expected-note 12 {{'foo_dep' has been explicitly marked deprecated here}}
 foo_dep *test2;    // expected-warning {{'foo_dep' is deprecated}}
 
 struct __attribute__((deprecated, 
-                      invalid_attribute)) bar_dep ;  // expected-warning {{unknown attribute 'invalid_attribute' ignored}} expected-note 2 {{declared here}}
+                      invalid_attribute)) bar_dep ;  // expected-warning {{unknown attribute 'invalid_attribute' ignored}} expected-note 2 {{'bar_dep' has been explicitly marked deprecated here}}
 
 struct bar_dep *test3;   // expected-warning {{'bar_dep' is deprecated}}
 
@@ -102,9 +102,9 @@ foo_dep test17, // expected-warning {{'foo_dep' is deprecated}}
         test19;
 
 // rdar://problem/8518751
-enum __attribute__((deprecated)) Test20 { // expected-note {{declared here}}
-  test20_a __attribute__((deprecated)), // expected-note {{declared here}}
-  test20_b // expected-note {{declared here}}
+enum __attribute__((deprecated)) Test20 { // expected-note {{'Test20' has been explicitly marked deprecated here}}
+  test20_a __attribute__((deprecated)), // expected-note {{'test20_a' has been explicitly marked deprecated here}}
+  test20_b // expected-note {{'test20_b' has been explicitly marked deprecated here}}
 };
 void test20() {
   enum Test20 f; // expected-warning {{'Test20' is deprecated}}
@@ -122,5 +122,5 @@ struct test22 {
 };
 
 typedef int test23_ty __attribute((deprecated)); // expected-note {{previous definition is here}}
-typedef int test23_ty; // expected-note {{'test23_ty' declared here}} expected-warning {{redefinition of typedef 'test23_ty' is a C11 feature}}
+typedef int test23_ty; // expected-note {{'test23_ty' has been explicitly marked deprecated here}} expected-warning {{redefinition of typedef 'test23_ty' is a C11 feature}}
 test23_ty test23_v; // expected-warning {{'test23_ty' is deprecated}}
index ebdf945867febe269c18efc3d9d0eca58e4209a7..400a2c6328838329e5207163935bc3f5f8207a42 100644 (file)
@@ -1,8 +1,8 @@
 // RUN: %clang_cc1 -fsyntax-only -verify %s
 // rdar: //6734520
 
-int foo(int)  __attribute__((__unavailable__("USE IFOO INSTEAD"))); // expected-note {{function has been explicitly marked unavailable here}}
-double dfoo(double)  __attribute__((__unavailable__("NO LONGER"))); // expected-note 2 {{function has been explicitly marked unavailable here}}
+int foo(int)  __attribute__((__unavailable__("USE IFOO INSTEAD"))); // expected-note {{'foo' has been explicitly marked unavailable here}}
+double dfoo(double)  __attribute__((__unavailable__("NO LONGER"))); // expected-note 2 {{'dfoo' has been explicitly marked unavailable here}}
 
 void bar() __attribute__((__unavailable__)); // expected-note {{explicitly marked unavailable}}
 
@@ -34,13 +34,13 @@ void unavail(void) {
 
 // rdar://10201690
 enum foo {
-    a = 1, // expected-note {{declared here}}
-    b __attribute__((deprecated())) = 2, // expected-note {{declared here}}
+    a = 1, // expected-note {{'a' has been explicitly marked deprecated here}}
+    b __attribute__((deprecated())) = 2, // expected-note {{'b' has been explicitly marked deprecated here}}
     c = 3
 }__attribute__((deprecated()));
 
-enum fee { // expected-note {{declaration has been explicitly marked unavailable here}}
-    r = 1, // expected-note {{declaration has been explicitly marked unavailable here}}
+enum fee { // expected-note {{'fee' has been explicitly marked unavailable here}}
+    r = 1, // expected-note {{'r' has been explicitly marked unavailable here}}
     s = 2,
     t = 3
 }__attribute__((unavailable()));
index 1518c83701c15665dd517a9fa2c56f6e19d934ef..ba72b126d7c7521e49aced9b39281475fe121bcc 100644 (file)
@@ -1,25 +1,25 @@
 // RUN: %clang_cc1 %s -verify -fsyntax-only
 
-struct s { int a; } __attribute__((deprecated)) x;  // expected-warning {{'s' is deprecated}} expected-note 2 {{'s' declared here}}
+struct s { int a; } __attribute__((deprecated)) x;  // expected-warning {{'s' is deprecated}} expected-note 2 {{'s' has been explicitly marked deprecated here}}
 
 typeof(x) y;  // expected-warning {{'s' is deprecated}}
 
-union un{ int a; } __attribute__((deprecated)) u;  // expected-warning {{'un' is deprecated}} expected-note 2 {{'un' declared here}}
+union un{ int a; } __attribute__((deprecated)) u;  // expected-warning {{'un' is deprecated}} expected-note 2 {{'un' has been explicitly marked deprecated here}}
 
 typeof(     u) z; // expected-warning {{'un' is deprecated}}
 
-enum E{ one} __attribute__((deprecated))  e; // expected-warning {{'E' is deprecated}} expected-note 2 {{'E' declared here}}
+enum E{ one} __attribute__((deprecated))  e; // expected-warning {{'E' is deprecated}} expected-note 2 {{'E' has been explicitly marked deprecated here}}
 
 typeof( e) w; // expected-warning {{'E' is deprecated}}
 
-struct foo { int x; } __attribute__((deprecated)); // expected-note {{'foo' declared here}}
-typedef struct foo bar __attribute__((deprecated)); // expected-note {{'bar' declared here}}
+struct foo { int x; } __attribute__((deprecated)); // expected-note {{'foo' has been explicitly marked deprecated here}}
+typedef struct foo bar __attribute__((deprecated)); // expected-note {{'bar' has been explicitly marked deprecated here}}
 bar x1;        // expected-warning {{'bar' is deprecated}}
 
 int main() { typeof(x1) y; }   // expected-warning {{'foo' is deprecated}}
 
 struct gorf { int x; };
-typedef struct gorf T __attribute__((deprecated));  // expected-note {{'T' declared here}}
+typedef struct gorf T __attribute__((deprecated));  // expected-note {{'T' has been explicitly marked deprecated here}}
 T t;   // expected-warning {{'T' is deprecated}}
 void wee() { typeof(t) y; }
 
index 885bf703dc108b19b5624dfb7a4cc050dbc6a443..4e4177463f885a341315fb187f28e869fca741a9 100644 (file)
@@ -49,7 +49,7 @@ struct A {
   A(int);
   ~A();
   
-  A(const A&) = delete; // expected-note 2 {{function has been explicitly marked deleted here}}
+  A(const A&) = delete; // expected-note 2 {{'A' has been explicitly marked deleted here}}
 };
 
 struct B {
index b3223f399799f13a577d9984a17fa5a7b3527e71..d28eb75cca657e18760bd4f3fe19950c59661172 100644 (file)
@@ -1,10 +1,10 @@
 // RUN: %clang_cc1 %s -verify -fexceptions
 class A {
-  void f() __attribute__((deprecated)); // expected-note 2 {{declared here}}
+  void f() __attribute__((deprecated)); // expected-note 2 {{'f' has been explicitly marked deprecated here}}
   void g(A* a);
   void h(A* a) __attribute__((deprecated));
 
-  int b __attribute__((deprecated)); // expected-note 2 {{declared here}}
+  int b __attribute__((deprecated)); // expected-note 2 {{'b' has been explicitly marked deprecated here}}
 };
 
 void A::g(A* a)
@@ -26,7 +26,7 @@ void A::h(A* a)
 }
 
 struct B {
-  virtual void f() __attribute__((deprecated)); // expected-note 4 {{declared here}}
+  virtual void f() __attribute__((deprecated)); // expected-note 4 {{'f' has been explicitly marked deprecated here}}
   void g();
 };
 
@@ -68,20 +68,20 @@ void f(D* d) {
 
 // Overloaded namespace members.
 namespace test1 {
-  void foo(int) __attribute__((deprecated)); // expected-note {{declared here}}
+  void foo(int) __attribute__((deprecated)); // expected-note {{'foo' has been explicitly marked deprecated here}}
   void test1() { foo(10); } // expected-warning {{deprecated}}
-  void foo(short) __attribute__((deprecated)); // expected-note {{declared here}}
+  void foo(short) __attribute__((deprecated)); // expected-note {{'foo' has been explicitly marked deprecated here}}
   void test2(short s) { foo(s); } // expected-warning {{deprecated}}
   void foo(long);
   void test3(long l) { foo(l); }
   struct A {
-    friend void foo(A*) __attribute__((deprecated)); // expected-note {{declared here}}
+    friend void foo(A*) __attribute__((deprecated)); // expected-note {{'foo' has been explicitly marked deprecated here}}
   };
   void test4(A *a) { foo(a); } // expected-warning {{deprecated}}
 
   namespace ns {
     struct Foo {};
-    void foo(const Foo &f) __attribute__((deprecated)); // expected-note {{declared here}}
+    void foo(const Foo &f) __attribute__((deprecated)); // expected-note {{'foo' has been explicitly marked deprecated here}}
   }
   void test5() {
     foo(ns::Foo()); // expected-warning {{deprecated}}
@@ -91,9 +91,9 @@ namespace test1 {
 // Overloaded class members.
 namespace test2 {
   struct A {
-    void foo(int) __attribute__((deprecated)); // expected-note 2 {{declared here}}
+    void foo(int) __attribute__((deprecated)); // expected-note 2 {{'foo' has been explicitly marked deprecated here}}
     void foo(long);
-    static void bar(int) __attribute__((deprecated)); // expected-note 3 {{declared here}}
+    static void bar(int) __attribute__((deprecated)); // expected-note 3 {{'bar' has been explicitly marked deprecated here}}
     static void bar(long);
 
     void test2(int i, long l);
@@ -120,12 +120,12 @@ namespace test2 {
 namespace test3 {
   struct A {
     void operator*(const A &);
-    void operator*(int) __attribute__((deprecated)); // expected-note {{declared here}}
+    void operator*(int) __attribute__((deprecated)); // expected-note {{'operator*' has been explicitly marked deprecated here}}
     void operator-(const A &) const;
   };
   void operator+(const A &, const A &);
-  void operator+(const A &, int) __attribute__((deprecated)); // expected-note {{declared here}}
-  void operator-(const A &, int) __attribute__((deprecated)); // expected-note {{declared here}}
+  void operator+(const A &, int) __attribute__((deprecated)); // expected-note {{'operator+' has been explicitly marked deprecated here}}
+  void operator-(const A &, int) __attribute__((deprecated)); // expected-note {{'operator-' has been explicitly marked deprecated here}}
 
   void test() {
     A a, b;
@@ -143,9 +143,9 @@ namespace test4 {
   struct A {
     typedef void (*intfn)(int);
     typedef void (*unintfn)(unsigned);
-    operator intfn() __attribute__((deprecated)); // expected-note {{declared here}}
+    operator intfn() __attribute__((deprecated)); // expected-note {{'operator void (*)(int)' has been explicitly marked deprecated here}}
     operator unintfn();
-    void operator ()(A &) __attribute__((deprecated)); // expected-note {{declared here}}
+    void operator ()(A &) __attribute__((deprecated)); // expected-note {{'operator()' has been explicitly marked deprecated here}}
     void operator ()(const A &);
   };
 
@@ -163,7 +163,7 @@ namespace test4 {
 
 namespace test5 {
   struct A {
-    operator int() __attribute__((deprecated)); // expected-note 3 {{declared here}}
+    operator int() __attribute__((deprecated)); // expected-note 3 {{'operator int' has been explicitly marked deprecated here}}
     operator long();
   };
   void test1(A a) {
@@ -193,8 +193,8 @@ namespace test5 {
 
 // rdar://problem/8518751
 namespace test6 {
-  enum __attribute__((deprecated)) A { // expected-note {{declared here}}
-    a0 // expected-note {{declared here}}
+  enum __attribute__((deprecated)) A { // expected-note {{'A' has been explicitly marked deprecated here}}
+    a0 // expected-note {{'a0' has been explicitly marked deprecated here}}
   };
   void testA() {
     A x; // expected-warning {{'A' is deprecated}}
@@ -202,7 +202,7 @@ namespace test6 {
   }
   
   enum B {
-    b0 __attribute__((deprecated)), // expected-note {{declared here}}
+    b0 __attribute__((deprecated)), // expected-note {{'b0' has been explicitly marked deprecated here}}
     b1
   };
   void testB() {
@@ -212,8 +212,8 @@ namespace test6 {
   }
 
   template <class T> struct C {
-    enum __attribute__((deprecated)) Enum { // expected-note {{declared here}}
-      c0 // expected-note {{declared here}}
+    enum __attribute__((deprecated)) Enum { // expected-note {{'Enum' has been explicitly marked deprecated here}}
+      c0 // expected-note {{'c0' has been explicitly marked deprecated here}}
     };
   };
   void testC() {
@@ -224,7 +224,7 @@ namespace test6 {
   template <class T> struct D {
     enum Enum {
       d0,
-      d1 __attribute__((deprecated)), // expected-note {{declared here}}
+      d1 __attribute__((deprecated)), // expected-note {{'d1' has been explicitly marked deprecated here}}
     };
   };
   void testD() {
@@ -236,8 +236,8 @@ namespace test6 {
 
 namespace test7 {
   struct X {
-    void* operator new(typeof(sizeof(void*))) __attribute__((deprecated));  // expected-note{{'operator new' declared here}}
-    void operator delete(void *) __attribute__((deprecated));  // expected-note{{'operator delete' declared here}}
+    void* operator new(typeof(sizeof(void*))) __attribute__((deprecated));  // expected-note{{'operator new' has been explicitly marked deprecated here}}
+    void operator delete(void *) __attribute__((deprecated));  // expected-note{{'operator delete' has been explicitly marked deprecated here}}
   };
 
   void test() {
@@ -247,6 +247,6 @@ namespace test7 {
 
 // rdar://problem/15044218
 typedef struct TDS {
-} TDS __attribute__((deprecated)); // expected-note {{'TDS' declared here}}
+} TDS __attribute__((deprecated)); // expected-note {{'TDS' has been explicitly marked deprecated here}}
 TDS tds; // expected-warning {{'TDS' is deprecated}}
 struct TDS tds2; // no warning, attribute only applies to the typedef.
index 2d82668a205a33289a38b9c26c19b1c661f928df..51dc8fe3789efafe57b6a7398fc16c2036512e23 100644 (file)
@@ -3,7 +3,7 @@
 int &foo(int); // expected-note {{candidate}}
 double &foo(double); // expected-note {{candidate}}
 void foo(...) __attribute__((__unavailable__)); // expected-note {{candidate function}} \
-// expected-note{{function has been explicitly marked unavailable here}}
+// expected-note{{'foo' has been explicitly marked unavailable here}}
 
 void bar(...) __attribute__((__unavailable__)); // expected-note 2{{explicitly marked unavailable}}
 
@@ -37,3 +37,22 @@ void unavail(short* sp) {
   foo(sp);
   foo();
 }
+
+// Show that delayed processing of 'unavailable' is the same
+// delayed process for 'deprecated'.
+// <rdar://problem/12241361> and <rdar://problem/15584219>
+enum DeprecatedEnum { DE_A, DE_B } __attribute__((deprecated)); // expected-note {{'DeprecatedEnum' has been explicitly marked deprecated here}}
+__attribute__((deprecated)) typedef enum DeprecatedEnum DeprecatedEnum;
+typedef enum DeprecatedEnum AnotherDeprecatedEnum; // expected-warning {{'DeprecatedEnum' is deprecated}}
+
+__attribute__((deprecated))
+DeprecatedEnum testDeprecated(DeprecatedEnum X) { return X; }
+
+
+enum UnavailableEnum { UE_A, UE_B } __attribute__((unavailable)); // expected-note {{'UnavailableEnum' has been explicitly marked unavailable here}}
+__attribute__((unavailable)) typedef enum UnavailableEnum UnavailableEnum;
+typedef enum UnavailableEnum AnotherUnavailableEnum; // expected-error {{'UnavailableEnum' is unavailable}}
+
+
+__attribute__((unavailable))
+UnavailableEnum testUnavailable(UnavailableEnum X) { return X; }
index a34ee4fcb024f91ced41569c77962dfb3e062451..2e1abf53ae99b63c7078d399fa970d64b457bf15 100644 (file)
@@ -43,7 +43,7 @@ foo::foo (void*) : foo(4.0f) {
 }
 
 struct deleted_dtor {
-  ~deleted_dtor() = delete; // expected-note{{function has been explicitly marked deleted here}}
+  ~deleted_dtor() = delete; // expected-note{{'~deleted_dtor' has been explicitly marked deleted here}}
   deleted_dtor();
   deleted_dtor(int) : deleted_dtor() // expected-error{{attempt to use a deleted function}}
   {}
index e78e7edc7199862b22d3ca99f218c234d695aebf..d7ef9b263d8818aac3d7e3fb3d6d67177356c9ee 100644 (file)
@@ -15,9 +15,9 @@ void ov(int) {} // expected-note {{candidate function}}
 void ov(double) = delete; // expected-note {{candidate function has been explicitly deleted}}
 
 struct WithDel {
-  WithDel() = delete; // expected-note {{function has been explicitly marked deleted here}}
-  void fn() = delete; // expected-note {{function has been explicitly marked deleted here}}
-  operator int() = delete; // expected-note {{function has been explicitly marked deleted here}}
+  WithDel() = delete; // expected-note {{'WithDel' has been explicitly marked deleted here}}
+  void fn() = delete; // expected-note {{'fn' has been explicitly marked deleted here}}
+  operator int() = delete; // expected-note {{'operator int' has been explicitly marked deleted here}}
   void operator +(int) = delete;
 
   int i = delete; // expected-error {{only functions can have deleted definitions}}
index bf3187da30e2ee59e9bd2a0fa29ad07ccd80adc8..7377199024e511f722a6466b8e4a512720b68745 100644 (file)
@@ -11,7 +11,7 @@ struct NoBegin {
 
 struct DeletedEnd : public T {
   Data *begin();
-  Data *end() = delete; //expected-note {{function has been explicitly marked deleted here}}
+  Data *end() = delete; //expected-note {{'end' has been explicitly marked deleted here}}
 };
 
 struct DeletedADLBegin { };
index 710a5dbde0221430f7aed65df170cf8e10064471..ed97a1df548d9cc2cd11b368b58ddcf00333b66f 100644 (file)
@@ -1,7 +1,7 @@
 // RUN: %clang_cc1 -triple i686-pc-win32 -cxx-abi microsoft -std=c++11 -verify %s
 
 struct S {
-  virtual ~S() = delete; // expected-note {{function has been explicitly marked deleted here}}
+  virtual ~S() = delete; // expected-note {{'~S' has been explicitly marked deleted here}}
   void operator delete(void*, int);
   void operator delete(void*, double);
 } s; // expected-error {{attempt to use a deleted function}}
index 110ae26fb5d298dd2f2f99d8e88dfd6b653f49eb..8a5b562bbb9825fe7e95748009efde6c045695f7 100644 (file)
@@ -4,7 +4,7 @@ template<typename T>
 class unique_ptr {
   T *ptr;
 
-  unique_ptr(const unique_ptr&) = delete; // expected-note 3{{function has been explicitly marked deleted here}}
+  unique_ptr(const unique_ptr&) = delete; // expected-note 3{{'unique_ptr' has been explicitly marked deleted here}}
   unique_ptr &operator=(const unique_ptr&) = delete; // expected-note{{candidate function has been explicitly deleted}}
 public:
   unique_ptr() : ptr(0) { }
index b0b70db641cb5ef75a8c7bb205c51b0d3743b262..54ceaafbd699c5cc59159ad8583a4d111755ff60 100644 (file)
@@ -3,7 +3,7 @@
 
 # 1 "<command line>"
 # 1 "/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h" 1 3
-id * foo(); // expected-note {{function has been explicitly marked unavailable here}}
+id * foo(); // expected-note {{'foo' has been explicitly marked unavailable here}}
 
 # 1 "arc-unavailable-system-function.m" 2
 void ret() {
index fddcd506d44dc98fb14f10e46d04dcb046663567..7990b1202e8ffac705111e991fe8b6363e2df274 100644 (file)
@@ -1,11 +1,11 @@
 // RUN: %clang_cc1 -triple x86_64-apple-darwin9.0.0 -fsyntax-only -verify %s
 
 @protocol P
-- (void)proto_method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note 2 {{method 'proto_method' declared here}}
+- (void)proto_method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note 2 {{'proto_method' has been explicitly marked deprecated here}}
 @end
 
 @interface A <P>
-- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}}
+- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{'method' has been explicitly marked deprecated here}}
 
 - (void)overridden __attribute__((availability(macosx,introduced=10.3))); // expected-note{{overridden method is here}}
 - (void)overridden2 __attribute__((availability(macosx,introduced=10.3)));
@@ -37,7 +37,7 @@ void f(A *a, B *b) {
 // using a deprecated method when that method is re-implemented in a
 // subclass where the redeclared method is not deprecated.
 @interface C
-- (void) method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{method 'method' declared here}}
+- (void) method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{'method' has been explicitly marked deprecated here}}
 @end
 
 @interface D : C
index cf2e063762c2009cc2ff21ed52c3bee11195f0aa..9dba48eced77fca391e7713d46219f0423a983d9 100644 (file)
@@ -2,10 +2,10 @@
 // RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class %s
 
 @interface A {
-  int X __attribute__((deprecated)); // expected-note 2 {{declared here}}
+  int X __attribute__((deprecated)); // expected-note 2 {{'X' has been explicitly marked deprecated here}}
 }
-+ (void)F __attribute__((deprecated)); // expected-note 2 {{declared here}}
-- (void)f __attribute__((deprecated)); // expected-note 4 {{declared here}}
++ (void)F __attribute__((deprecated)); // expected-note 2 {{'F' has been explicitly marked deprecated here}}
+- (void)f __attribute__((deprecated)); // expected-note 4 {{'f' has been explicitly marked deprecated here}}
 @end
 
 @implementation A
@@ -43,7 +43,7 @@
 @end
 
 @protocol P
-- (void)p __attribute__((deprecated)); // expected-note {{declared here}}
+- (void)p __attribute__((deprecated)); // expected-note {{'p' has been explicitly marked deprecated here}}
 @end
 
 void t1(A *a)
@@ -72,7 +72,7 @@ void t4(Class c)
 
 @interface Bar 
 
-@property (assign, setter = MySetter:) int FooBar __attribute__ ((deprecated)); // expected-note 2 {{declared here}}
+@property (assign, setter = MySetter:) int FooBar __attribute__ ((deprecated)); // expected-note 2 {{'FooBar' has been explicitly marked deprecated here}}
 - (void) MySetter : (int) value;
 @end
 
@@ -84,7 +84,7 @@ int t5() {
 
 
 __attribute ((deprecated))  
-@interface DEPRECATED { // expected-note 2 {{declared here}}
+@interface DEPRECATED { // expected-note 2 {{'DEPRECATED' has been explicitly marked deprecated here}}
   @public int ivar; 
   DEPRECATED *ivar2; // no warning.
 } 
@@ -108,8 +108,8 @@ __attribute ((deprecated))
 
 
 @interface Test2
-@property int test2 __attribute__((deprecated)); // expected-note 4 {{declared here}} \
-                                                // expected-note 2 {{property 'test2' is declared deprecated here}}
+@property int test2 __attribute__((deprecated)); // expected-note 2 {{property 'test2' is declared deprecated here}} expected-note 3 {{'test2' has been explicitly marked deprecated here}} \
+                                                // expected-note {{'setTest2:' has been explicitly marked deprecated here}}
 @end
 
 void test(Test2 *foo) {
@@ -127,7 +127,7 @@ __attribute__((deprecated))
 
 typedef struct {
        int x;
-} footype __attribute((deprecated)); // expected-note 2 {{declared here}}
+} footype __attribute((deprecated)); // expected-note 2 {{'footype' has been explicitly marked deprecated here}}
 
 @interface foo {
        footype a; // expected-warning {{'footype' is deprecated}}
@@ -142,7 +142,7 @@ typedef struct {
 +(void)cmeth;
 @end
 
-typedef NewI DeprI __attribute__((deprecated("blah"))); // expected-note 4 {{'DeprI' declared here}}
+typedef NewI DeprI __attribute__((deprecated("blah"))); // expected-note 4 {{'DeprI' has been explicitly marked deprecated here}}
 
 @interface SI : DeprI // expected-warning {{'DeprI' is deprecated: blah}}
 -(DeprI*)meth; // expected-warning {{'DeprI' is deprecated: blah}}
index b2bd38831101c444b26a1e01ec0755d39f237990..a337c97ec083aef4826bce8b5dda66cb8416dd9b 100644 (file)
@@ -2,7 +2,7 @@
 // rdar://9092208
 
 __attribute__((unavailable("not available")))
-@interface MyClass { // expected-note 8 {{declaration has been explicitly marked unavailable here}}
+@interface MyClass { // expected-note 8 {{'MyClass' has been explicitly marked unavailable here}}
 @public
     void *_test;
     MyClass *ivar; // no error.
index 7e10356ac577b6ee2fbc8c1e12d2b363ae321466..c89edb9420887d08001678f9ae661b00707e9333 100644 (file)
@@ -5,7 +5,7 @@
 typedef signed char BOOL;
 
 @protocol P
-@property(nonatomic,assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'ptarget' is declared deprecated here}} expected-note {{method 'ptarget' declared here}}
+@property(nonatomic,assign) id ptarget __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'ptarget' is declared deprecated here}} expected-note {{'ptarget' has been explicitly marked deprecated here}}
 @end
 
 @protocol P1<P>
@@ -14,7 +14,7 @@ typedef signed char BOOL;
 
 
 @interface UITableViewCell<P1>
-@property(nonatomic,assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'target' is declared deprecated here}} expected-note {{method 'setTarget:' declared here}}
+@property(nonatomic,assign) id target __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{property 'target' is declared deprecated here}} expected-note {{'setTarget:' has been explicitly marked deprecated here}}
 @end
 
 @interface PSTableCell : UITableViewCell
@@ -22,9 +22,9 @@ typedef signed char BOOL;
 @end
 
 @interface UITableViewCell(UIDeprecated)
-@property(nonatomic,assign) id dep_target  __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note 2 {{method 'dep_target' declared here}} \
+@property(nonatomic,assign) id dep_target  __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note 2 {{'dep_target' has been explicitly marked deprecated here}} \
                                                                                     // expected-note 4 {{property 'dep_target' is declared deprecated here}} \
-                                                                                    // expected-note 2 {{method 'setDep_target:' declared here}}
+                                                                                    // expected-note 2 {{'setDep_target:' has been explicitly marked deprecated here}}
 @end
 
 @implementation PSTableCell
@@ -55,9 +55,9 @@ typedef signed char BOOL;
 
 
 @interface CustomAccessorNames
-@property(getter=isEnabled,assign) BOOL enabled __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{method 'isEnabled' declared here}} expected-note {{property 'enabled' is declared deprecated here}}
+@property(getter=isEnabled,assign) BOOL enabled __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'isEnabled' has been explicitly marked deprecated here}} expected-note {{property 'enabled' is declared deprecated here}}
 
-@property(setter=setNewDelegate:,assign) id delegate __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{method 'setNewDelegate:' declared here}} expected-note {{property 'delegate' is declared deprecated here}}
+@property(setter=setNewDelegate:,assign) id delegate __attribute__((availability(ios,introduced=2.0,deprecated=3.0))); // expected-note {{'setNewDelegate:' has been explicitly marked deprecated here}} expected-note {{property 'delegate' is declared deprecated here}}
 @end
 
 void testCustomAccessorNames(CustomAccessorNames *obj) {
index f53a1a61d53a8f77b4f9cd8289dbf97ac74673e1..793ceb6dc08e44d989e798e36cf53efb2cb16a34 100644 (file)
@@ -5,13 +5,12 @@
 
 @interface NSObject @end
 @protocol myProtocol
-@property int myProtocolProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); // expected-note {{method 'myProtocolProperty' declared here}} \
+@property int myProtocolProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8))); // expected-note {{'myProtocolProperty' has been explicitly marked deprecated here}} \
                                                                                                         // expected-note {{property 'myProtocolProperty' is declared deprecated here}}
 @end
 
 @interface Foo : NSObject
-@property int myProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8)));  // expected-note {{'myProperty' declared here}} \
-                                                               // expected-note {{method 'myProperty' declared here}} \
+@property int myProperty __attribute__((availability(macosx,introduced=10.7,deprecated=10.8)));  // expected-note 2 {{'myProperty' has been explicitly marked deprecated here}} \
                                                                // expected-note {{property 'myProperty' is declared deprecated here}}
 @end
 
index b2aecc209f1bf035af906ae2d4c475bed4335bdf..52bd44110fc91ff16f657443fe6d54174f66dae1 100644 (file)
@@ -6,7 +6,7 @@ __attribute ((unavailable))
 Class <FwProto> cFw = 0;  // expected-error {{'FwProto' is unavailable}}
 
 
-__attribute ((deprecated)) @protocol MyProto1 // expected-note 7 {{declared here}}
+__attribute ((deprecated)) @protocol MyProto1 // expected-note 7 {{'MyProto1' has been explicitly marked deprecated here}}
 @end
 
 @protocol Proto2  <MyProto1>  // expected-warning {{'MyProto1' is deprecated}}
index a179647ebccd4741ff707d0f9cfa923ce1858b89..29e215348b74804388575b221defb953eb3c0c92 100644 (file)
@@ -4,30 +4,30 @@
 @interface B
 - (void) depInA;
 - (void) unavailMeth __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
-- (void) depInA1 __attribute__((deprecated));
+- (void) depInA1 __attribute__((deprecated)); // expected-note {{'depInA1' has been explicitly marked deprecated here}}
 - (void) unavailMeth1;
-- (void) depInA2 __attribute__((deprecated));
+- (void) depInA2 __attribute__((deprecated)); // expected-note {{'depInA2' has been explicitly marked deprecated here}}
 - (void) unavailMeth2 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
 - (void) depunavailInA;
 - (void) depunavailInA1 __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
-- (void)FuzzyMeth __attribute__((deprecated));
+- (void)FuzzyMeth __attribute__((deprecated)); // expected-note {{'FuzzyMeth' has been explicitly marked deprecated here}}
 - (void)FuzzyMeth1 __attribute__((unavailable));
 @end
 
 @interface A
 - (void) unavailMeth1 __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
-- (void) depInA __attribute__((deprecated));
+- (void) depInA __attribute__((deprecated)); // expected-note {{'depInA' has been explicitly marked deprecated here}}
 - (void) depInA2 __attribute__((deprecated));
 - (void) depInA1;
 - (void) unavailMeth2 __attribute__((unavailable)); 
 - (void) depunavailInA __attribute__((deprecated)) __attribute__((unavailable)); // expected-note {{has been explicitly marked unavailable here}}
 - (void) depunavailInA1;
 - (void)FuzzyMeth __attribute__((unavailable));
-- (void)FuzzyMeth1 __attribute__((deprecated));
+- (void)FuzzyMeth1 __attribute__((deprecated)); // expected-note {{'FuzzyMeth1' has been explicitly marked deprecated here}}
 @end
 
 
-@class C;      // expected-note 5 {{forward declaration of class here}}
+@class C;      // expected-note 10 {{forward declaration of class here}}
 
 void test(C *c) {
   [c depInA]; // expected-warning {{'depInA' maybe deprecated because receiver type is unknown}}
@@ -45,7 +45,7 @@ void test(C *c) {
 
 // rdar://10268422
 __attribute ((deprecated))
-@interface DEPRECATED // expected-note {{declared here}}
+@interface DEPRECATED // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}}
 +(id)new;
 @end
 
index f63962f96180ec44ae1ca04748d6f97ed946e70f..e346fbebec96c227addb5ddbb6f4a6a5bf7f26ad 100644 (file)
@@ -29,7 +29,7 @@
 @end
 
 __attribute__((deprecated))
-@interface CL // expected-note 2 {{class declared here}} // expected-note 2 {{declared here}}
+@interface CL // expected-note 2 {{class declared here}} // expected-note 2 {{'CL' has been explicitly marked deprecated here}}
 @end
 
 @implementation CL // expected-warning {{Implementing deprecated class}}
index 854ff699eed4bc12277ef0cd1b3c19657c601dc6..ba365ba5e4530da20152b2627d6ea6c6209831cf 100644 (file)
@@ -4,7 +4,7 @@
 @class ABGroupImportFilesScope; // expected-note {{forward declaration of class here}}
 
 @interface I1
-- (id) filenames __attribute__((deprecated));
+- (id) filenames __attribute__((deprecated)); // expected-note {{'filenames' has been explicitly marked deprecated here}}
 @end
 
 @interface I2
index 928694db25283608851482e7c4b783c734480cff..70dd394845ce1fda13502f829b7fc16c304592cf 100644 (file)
@@ -3,7 +3,7 @@
 
 @protocol TestProtocol 
 - (void)newProtocolMethod;
-- (void)deprecatedProtocolMethod __attribute__((deprecated)); // expected-note 2 {{method 'deprecatedProtocolMethod' declared here}}
+- (void)deprecatedProtocolMethod __attribute__((deprecated)); // expected-note 2 {{'deprecatedProtocolMethod' has been explicitly marked deprecated here}}
 @end
 
 @interface NSObject @end
@@ -11,7 +11,7 @@
 @interface TestClass : NSObject <TestProtocol>
 
 - (void)newInstanceMethod;
-- (void)deprecatedInstanceMethod __attribute__((deprecated)); // expected-note {{method 'deprecatedInstanceMethod' declared here}}
+- (void)deprecatedInstanceMethod __attribute__((deprecated)); // expected-note {{'deprecatedInstanceMethod' has been explicitly marked deprecated here}}
 
 @end
 
index 3358e5fc1277ae8ec0cf44f2774db37449f5319a..b97e2f3b1eb4c2a32e25216954db61d7f0fc5177 100644 (file)
@@ -6,4 +6,4 @@ void f(A* a) {
   a->data.void_ptr = 0;
   a->data.a_b.b = 0; // expected-error{{'a_b' is unavailable: this system field has retaining ownership}}
 }
-// expected-note@arc-system-header.h:10{{declaration has been explicitly marked unavailable here}}
+// expected-note@arc-system-header.h:10{{'a_b' has been explicitly marked unavailable here}}