r351108 - Improve a -Wunguarded-availability note
Erik Pilkington via cfe-commits
cfe-commits at lists.llvm.org
Mon Jan 14 11:17:31 PST 2019
Author: epilk
Date: Mon Jan 14 11:17:31 2019
New Revision: 351108
URL: http://llvm.org/viewvc/llvm-project?rev=351108&view=rev
Log:
Improve a -Wunguarded-availability note
Mention the deployment target, and don't say "partial" which doesn't
really mean anything to users.
rdar://problem/33601513
Differential revision: https://reviews.llvm.org/D56523
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaDeclAttr.cpp
cfe/trunk/lib/Sema/SemaExpr.cpp
cfe/trunk/test/Sema/attr-availability.c
cfe/trunk/test/Sema/availability-guard-format.mm
cfe/trunk/test/SemaObjC/attr-availability.m
cfe/trunk/test/SemaObjC/property-deprecated-warning.m
cfe/trunk/test/SemaObjC/unguarded-availability-new.m
cfe/trunk/test/SemaObjC/unguarded-availability.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Mon Jan 14 11:17:31 2019
@@ -4565,7 +4565,10 @@ def warn_unavailable_fwdclass_message :
InGroup<UnavailableDeclarations>;
def note_availability_specified_here : Note<
"%0 has been explicitly marked "
- "%select{unavailable|deleted|deprecated|partial}1 here">;
+ "%select{unavailable|deleted|deprecated}1 here">;
+def note_partial_availability_specified_here : Note<
+ "%0 has been marked as being introduced in %1 %2 here, "
+ "but the deployment target is %1 %3">;
def note_implicitly_deleted : Note<
"explicitly defaulted function was implicitly deleted here">;
def warn_not_enough_argument : Warning<
Modified: cfe/trunk/lib/Sema/SemaDeclAttr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclAttr.cpp?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclAttr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclAttr.cpp Mon Jan 14 11:17:31 2019
@@ -7584,14 +7584,16 @@ static void DoEmitAvailabilityWarning(Se
unsigned Warning = UseNewWarning ? diag::warn_unguarded_availability_new
: diag::warn_unguarded_availability;
- S.Diag(Loc, Warning)
- << OffendingDecl
- << AvailabilityAttr::getPrettyPlatformName(
- S.getASTContext().getTargetInfo().getPlatformName())
- << Introduced.getAsString();
+ std::string PlatformName = AvailabilityAttr::getPrettyPlatformName(
+ S.getASTContext().getTargetInfo().getPlatformName());
- S.Diag(OffendingDecl->getLocation(), diag::note_availability_specified_here)
- << OffendingDecl << /* partial */ 3;
+ S.Diag(Loc, Warning) << OffendingDecl << PlatformName
+ << Introduced.getAsString();
+
+ S.Diag(OffendingDecl->getLocation(),
+ diag::note_partial_availability_specified_here)
+ << OffendingDecl << PlatformName << Introduced.getAsString()
+ << S.Context.getTargetInfo().getPlatformMinVersion().getAsString();
if (const auto *Enclosing = findEnclosingDeclToAnnotate(Ctx)) {
if (const auto *TD = dyn_cast<TagDecl>(Enclosing))
@@ -8045,15 +8047,18 @@ void DiagnoseUnguardedAvailability::Diag
? diag::warn_unguarded_availability_new
: diag::warn_unguarded_availability;
+ std::string PlatformName = AvailabilityAttr::getPrettyPlatformName(
+ SemaRef.getASTContext().getTargetInfo().getPlatformName());
+
SemaRef.Diag(Range.getBegin(), DiagKind)
- << Range << D
- << AvailabilityAttr::getPrettyPlatformName(
- SemaRef.getASTContext().getTargetInfo().getPlatformName())
- << Introduced.getAsString();
+ << Range << D << PlatformName << Introduced.getAsString();
SemaRef.Diag(OffendingDecl->getLocation(),
- diag::note_availability_specified_here)
- << OffendingDecl << /* partial */ 3;
+ diag::note_partial_availability_specified_here)
+ << OffendingDecl << PlatformName << Introduced.getAsString()
+ << SemaRef.Context.getTargetInfo()
+ .getPlatformMinVersion()
+ .getAsString();
auto FixitDiag =
SemaRef.Diag(Range.getBegin(), diag::note_unguarded_available_silence)
Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jan 14 11:17:31 2019
@@ -121,7 +121,7 @@ void Sema::NoteDeletedFunction(FunctionD
return NoteDeletedInheritingConstructor(Ctor);
Diag(Decl->getLocation(), diag::note_availability_specified_here)
- << Decl << true;
+ << Decl << 1;
}
/// Determine whether a FunctionDecl was ever declared with an
Modified: cfe/trunk/test/Sema/attr-availability.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/attr-availability.c?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/Sema/attr-availability.c (original)
+++ cfe/trunk/test/Sema/attr-availability.c Mon Jan 14 11:17:31 2019
@@ -16,13 +16,13 @@ extern void
ATSFontGetPostScriptName(int flags) __attribute__((availability(macosx,introduced=8.0,obsoleted=9.0, message="use ATSFontGetFullPostScriptName"))); // expected-note {{'ATSFontGetPostScriptName' has been explicitly marked unavailable here}}
#if defined(WARN_PARTIAL)
-// expected-note at +3 {{has been explicitly marked partial here}}
+// expected-note at +3 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
extern void
PartiallyAvailable() __attribute__((availability(macosx,introduced=10.8)));
#ifdef WARN_PARTIAL
-// expected-note at +2 2 {{marked partial here}}
+// expected-note at +2 2 {{'PartialEnum' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
enum __attribute__((availability(macosx,introduced=10.8))) PartialEnum {
kPartialEnumConstant,
@@ -41,7 +41,7 @@ void test_10095131() {
#ifdef WARN_PARTIAL
// FIXME: This note should point to the declaration with the availability
// attribute.
-// expected-note at +2 {{marked partial here}}
+// expected-note at +2 {{'PartiallyAvailable' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
extern void PartiallyAvailable() ;
void with_redeclaration() {
Modified: cfe/trunk/test/Sema/availability-guard-format.mm
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Sema/availability-guard-format.mm?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/Sema/availability-guard-format.mm (original)
+++ cfe/trunk/test/Sema/availability-guard-format.mm Mon Jan 14 11:17:31 2019
@@ -1,9 +1,9 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx-10.11 -Wunguarded-availability -fdiagnostics-parseable-fixits -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.11 -Wunguarded-availability -fdiagnostics-parseable-fixits -fsyntax-only -verify %s
// Testing that even for source code using '_' as a delimiter in availability version tuple '.' is actually used in diagnostic output as a delimiter.
@interface foo
-- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been explicitly marked partial here}}
+- (void) method_bar __attribute__((availability(macosx, introduced = 10_12))); // expected-note {{'method_bar' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.11.0}}
@end
int main() {
Modified: cfe/trunk/test/SemaObjC/attr-availability.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/attr-availability.m?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/attr-availability.m (original)
+++ cfe/trunk/test/SemaObjC/attr-availability.m Mon Jan 14 11:17:31 2019
@@ -5,7 +5,7 @@
- (void)proto_method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note 2 {{'proto_method' has been explicitly marked deprecated here}}
#if defined(WARN_PARTIAL)
- // expected-note at +2 2 {{'partial_proto_method' has been explicitly marked partial here}}
+// expected-note at +2 2 {{'partial_proto_method' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
- (void)partial_proto_method __attribute__((availability(macosx,introduced=10.8)));
@end
@@ -13,7 +13,7 @@
@interface A <P>
- (void)method __attribute__((availability(macosx,introduced=10.1,deprecated=10.2))); // expected-note {{'method' has been explicitly marked deprecated here}}
#if defined(WARN_PARTIAL)
- // expected-note at +2 2 {{'partialMethod' has been explicitly marked partial here}}
+// expected-note at +2 2 {{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
- (void)partialMethod __attribute__((availability(macosx,introduced=10.8)));
@@ -137,8 +137,8 @@ id NSNibOwner, topNibObjects;
@interface PartialI <PartialProt>
#ifdef WARN_PARTIAL
-// expected-note at +3{{marked partial here}}
-// expected-note at +3{{marked partial here}}
+// expected-note at +3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
+// expected-note at +3{{'partialMethod' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
- (void)partialMethod __attribute__((availability(macosx,introduced=10.8)));
+ (void)partialMethod __attribute__((availability(macosx,introduced=10.8)));
@@ -147,12 +147,12 @@ id NSNibOwner, topNibObjects;
@interface PartialI ()
- (void)ipartialMethod1 __attribute__((availability(macosx,introduced=10.8)));
#if defined(WARN_PARTIAL)
- // expected-note at +2 {{'ipartialMethod2' has been explicitly marked partial here}}
+// expected-note at +2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
- (void)ipartialMethod2 __attribute__((availability(macosx,introduced=10.8)));
+ (void)ipartialMethod1 __attribute__((availability(macosx,introduced=10.8)));
#if defined(WARN_PARTIAL)
- // expected-note at +2 {{'ipartialMethod2' has been explicitly marked partial here}}
+// expected-note at +2 {{'ipartialMethod2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
+ (void)ipartialMethod2 __attribute__((availability(macosx,introduced=10.8)));
@end
@@ -190,7 +190,7 @@ void partialfun(PartialI* a) {
}
#if defined(WARN_PARTIAL)
- // expected-note at +2 2 {{'PartialI2' has been explicitly marked partial here}}
+// expected-note at +2 2 {{'PartialI2' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
#endif
__attribute__((availability(macosx, introduced = 10.8))) @interface PartialI2
@end
@@ -314,8 +314,8 @@ __attribute__((objc_root_class))
#if defined(WARN_PARTIAL)
int fn_10_5() __attribute__((availability(macosx, introduced=10.5)));
-int fn_10_7() __attribute__((availability(macosx, introduced=10.7))); // expected-note{{marked partial here}}
-int fn_10_8() __attribute__((availability(macosx, introduced=10.8))) { // expected-note{{marked partial here}}
+int fn_10_7() __attribute__((availability(macosx, introduced=10.7))); // expected-note{{'fn_10_7' has been marked as being introduced in macOS 10.7 here, but the deployment target is macOS 10.5.0}}
+int fn_10_8() __attribute__((availability(macosx, introduced=10.8))) { // expected-note{{'fn_10_8' has been marked as being introduced in macOS 10.8 here, but the deployment target is macOS 10.5.0}}
return fn_10_7();
}
Modified: cfe/trunk/test/SemaObjC/property-deprecated-warning.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/property-deprecated-warning.m?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/property-deprecated-warning.m (original)
+++ cfe/trunk/test/SemaObjC/property-deprecated-warning.m Mon Jan 14 11:17:31 2019
@@ -9,7 +9,7 @@ typedef signed char BOOL;
@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}}
#if defined(WARN_PARTIAL)
-// expected-note at +2 {{'partialPtarget' has been explicitly marked partial here}}
+// expected-note at +2 {{'partialPtarget' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
#endif
@property(nonatomic,assign) id partialPtarget __attribute__((availability(ios,introduced=5.0)));
@end
@@ -24,7 +24,7 @@ typedef signed char BOOL;
@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}}
#if defined(WARN_PARTIAL)
-// expected-note at +2 {{'setPartialTarget:' has been explicitly marked partial here}}
+// expected-note at +2 {{'setPartialTarget:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
#endif
@property(nonatomic,assign) id partialTarget __attribute__((availability(ios,introduced=5.0)));
@end
@@ -40,7 +40,8 @@ typedef signed char BOOL;
// expected-note 2 {{'setDep_target:' has been explicitly marked deprecated here}}
#if defined(WARN_PARTIAL)
-// expected-note at +2 2 {{'partial_dep_target' has been explicitly marked partial here}} expected-note at +2 2 {{'setPartial_dep_target:' has been explicitly marked partial here}}
+// expected-note at +3 2 {{'partial_dep_target' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
+// expected-note at +2 2 {{'setPartial_dep_target:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
#endif
@property(nonatomic,assign) id partial_dep_target __attribute__((availability(ios,introduced=5.0)));
@end
@@ -100,12 +101,12 @@ typedef signed char BOOL;
@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}}
#if defined(WARN_PARTIAL)
-// expected-note at +2 {{'partialIsEnabled' has been explicitly marked partial here}}
+// expected-note at +2 {{'partialIsEnabled' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
#endif
@property(getter=partialIsEnabled,assign) BOOL partialEnabled __attribute__((availability(ios,introduced=5.0)));
#if defined(WARN_PARTIAL)
-// expected-note at +2 {{'partialSetNewDelegate:' has been explicitly marked partial here}}
+// expected-note at +2 {{'partialSetNewDelegate:' has been marked as being introduced in iOS 5.0 here, but the deployment target is iOS 3.0.0}}
#endif
@property(setter=partialSetNewDelegate:,assign) id partialDelegate __attribute__((availability(ios,introduced=5.0)));
@end
Modified: cfe/trunk/test/SemaObjC/unguarded-availability-new.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/unguarded-availability-new.m?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/unguarded-availability-new.m (original)
+++ cfe/trunk/test/SemaObjC/unguarded-availability-new.m Mon Jan 14 11:17:31 2019
@@ -68,15 +68,15 @@
void previouslyAvailable() AVAILABLE_PREV;
#ifdef WARN_PREV
- // expected-note at -2 {{'previouslyAvailable' has been explicitly marked partial here}}
+// expected-note at -2 {{'previouslyAvailable' has been marked as being introduced}}
#endif
void currentlyAvailable() AVAILABLE_CURRENT;
#ifdef WARN_CURRENT
- // expected-note at -2 {{'currentlyAvailable' has been explicitly marked partial here}}
+// expected-note at -2 {{'currentlyAvailable' has been marked as being introduced}}
#endif
void willBeAvailabile() AVAILABLE_NEXT;
#ifndef NO_WARNING
- // expected-note at -2 {{'willBeAvailabile' has been explicitly marked partial here}}
+// expected-note at -2 {{'willBeAvailabile' has been marked as being introduced in}}
#endif
#ifdef TEST_FUNC_CURRENT
@@ -91,7 +91,7 @@ void willBeAvailabile() AVAILABLE_NEXT;
typedef int AVAILABLE_NEXT new_int;
#ifndef NO_WARNING
- // expected-note at -2 {{'new_int' has been explicitly marked partial here}}
+// expected-note at -2 {{'new_int' has been marked as being introduced in}}
#endif
FUNC_AVAILABLE new_int x;
#ifndef NO_WARNING
Modified: cfe/trunk/test/SemaObjC/unguarded-availability.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/unguarded-availability.m?rev=351108&r1=351107&r2=351108&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/unguarded-availability.m (original)
+++ cfe/trunk/test/SemaObjC/unguarded-availability.m Mon Jan 14 11:17:31 2019
@@ -1,18 +1,18 @@
-// RUN: %clang_cc1 -triple x86_64-apple-macosx-10.9 -Wunguarded-availability -fblocks -fsyntax-only -verify %s
-// RUN: %clang_cc1 -xobjective-c++ -std=c++11 -DOBJCPP -triple x86_64-apple-macosx-10.9 -Wunguarded-availability -fblocks -fsyntax-only -verify %s
+// RUN: %clang_cc1 -triple x86_64-apple-macosx10.9 -Wunguarded-availability -fblocks -fsyntax-only -verify %s
+// RUN: %clang_cc1 -xobjective-c++ -std=c++11 -DOBJCPP -triple x86_64-apple-macosx10.9 -Wunguarded-availability -fblocks -fsyntax-only -verify %s
#define AVAILABLE_10_0 __attribute__((availability(macos, introduced = 10.0)))
#define AVAILABLE_10_11 __attribute__((availability(macos, introduced = 10.11)))
#define AVAILABLE_10_12 __attribute__((availability(macos, introduced = 10.12)))
-typedef int AVAILABLE_10_12 new_int; // expected-note + {{marked partial here}}
+typedef int AVAILABLE_10_12 new_int; // expected-note + {{'new_int' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
-int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been explicitly marked partial here}}
+int func_10_11() AVAILABLE_10_11; // expected-note 8 {{'func_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}}
#ifdef OBJCPP
-// expected-note at +2 6 {{marked partial here}}
+// expected-note at +2 6 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
#endif
-int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been explicitly marked partial here}}
+int func_10_12() AVAILABLE_10_12; // expected-note 7 {{'func_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
int func_10_0() AVAILABLE_10_0;
@@ -61,11 +61,11 @@ void star_case() {
}
}
-typedef int int_10_11 AVAILABLE_10_11; // expected-note {{'int_10_11' has been explicitly marked partial here}}
+typedef int int_10_11 AVAILABLE_10_11; // expected-note {{'int_10_11' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}}
#ifdef OBJCPP
-// expected-note at +2 {{marked partial here}}
+// expected-note at +2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
#endif
-typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been explicitly marked partial here}}
+typedef int int_10_12 AVAILABLE_10_12; // expected-note 2 {{'int_10_12' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
void use_typedef() {
int_10_11 x; // expected-warning{{'int_10_11' is only available on macOS 10.11 or newer}} expected-note{{enclose 'int_10_11' in an @available check to silence this warning}}
@@ -106,10 +106,10 @@ int protected_scope() {
struct S {
int m1;
- int m2 __attribute__((availability(macos, introduced = 10.12))); // expected-note{{marked partial here}}
+ int m2 __attribute__((availability(macos, introduced = 10.12))); // expected-note{{has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
struct Nested {
- int nested_member __attribute__((availability(macos, introduced = 10.12))); // expected-note{{marked partial here}}
+ int nested_member __attribute__((availability(macos, introduced = 10.12))); // expected-note{{'nested_member' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
} n;
};
@@ -139,9 +139,9 @@ void (^topLevelBlockDecl)() = ^ {
AVAILABLE_10_12
__attribute__((objc_root_class))
- at interface InterWithProp // expected-note 2 {{marked partial here}}
+ at interface InterWithProp // expected-note 2 {{'InterWithProp' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
@property(class) int x;
-+ (void) setX: (int)newX AVAILABLE_10_12; // expected-note{{marked partial here}}
++ (void) setX: (int)newX AVAILABLE_10_12; // expected-note{{'setX:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
@end
void test_property(void) {
int y = InterWithProp.x; // expected-warning{{'InterWithProp' is only available on macOS 10.12 or newer}} expected-note{{@available}}
@@ -150,7 +150,7 @@ void test_property(void) {
__attribute__((objc_root_class))
@interface Subscriptable
-- (id)objectAtIndexedSubscript:(int)sub AVAILABLE_10_12; // expected-note{{marked partial here}}
+- (id)objectAtIndexedSubscript:(int)sub AVAILABLE_10_12; // expected-note{{'objectAtIndexedSubscript:' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
@end
void test_at(Subscriptable *x) {
@@ -196,7 +196,7 @@ int instantiate_template() {
}
template <class>
-int with_availability_attr() AVAILABLE_10_11 { // expected-note 2 {{marked partial here}}
+int with_availability_attr() AVAILABLE_10_11 { // expected-note 2 {{'with_availability_attr<int>' has been marked as being introduced in macOS 10.11 here, but the deployment target is macOS 10.9.0}}
return 0;
}
@@ -244,7 +244,7 @@ struct InStruct { // expected-note{{anno
};
#ifdef OBJCPP
-static constexpr int AVAILABLE_10_12 SomeConstexprValue = 2; // expected-note{{marked partial here}}
+static constexpr int AVAILABLE_10_12 SomeConstexprValue = 2; // expected-note{{'SomeConstexprValue' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
typedef enum { // expected-note{{annotate anonymous enum with an availability attribute}}
SomeValue = SomeConstexprValue // expected-warning{{'SomeConstexprValue' is only available on macOS 10.12 or newer}}
} SomeEnum;
@@ -268,7 +268,7 @@ void with_local_struct() {
// Avoid the warning on protocol requirements.
AVAILABLE_10_12
- at protocol NewProtocol // expected-note {{'NewProtocol' has been explicitly marked partial here}}
+ at protocol NewProtocol // expected-note {{'NewProtocol' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
@end
@protocol ProtocolWithNewProtocolRequirement <NewProtocol> // expected-note {{annotate 'ProtocolWithNewProtocolRequirement' with an availability attribute to silence}}
@@ -291,7 +291,7 @@ AVAILABLE_10_12
typedef enum {
AK_Dodo __attribute__((availability(macos, deprecated=10.3))), // expected-note 3 {{marked deprecated here}}
AK_Cat __attribute__((availability(macos, introduced=10.4))),
- AK_CyborgCat __attribute__((availability(macos, introduced=10.12))), // expected-note {{marked partial here}}
+ AK_CyborgCat __attribute__((availability(macos, introduced=10.12))), // expected-note {{'AK_CyborgCat' has been marked as being introduced in macOS 10.12 here, but the deployment target is macOS 10.9.0}}
} Animals;
void switchAnimals(Animals a) {
More information about the cfe-commits
mailing list