diff options
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 4 | ||||
-rw-r--r-- | clang/lib/Sema/SemaObjCProperty.cpp | 6 | ||||
-rw-r--r-- | clang/test/SemaObjC/default-synthesize-3.m | 4 | ||||
-rw-r--r-- | clang/test/SemaObjC/default-synthesize.m | 2 | ||||
-rw-r--r-- | clang/test/SemaObjC/forward-protocol-incomplete-impl-warn.m | 2 |
5 files changed, 10 insertions, 8 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 741d4c6e276..b0deed75ec5 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -701,8 +701,8 @@ def warn_owning_getter_rule : Warning< " convention for returning 'owned' objects">, InGroup<DiagGroup<"objc-property-matches-cocoa-ownership-rule">>; def warn_auto_synthesizing_protocol_property :Warning< - "auto property synthesis will not synthesize property" - " declared in a protocol">, + "auto property synthesis will not synthesize property %0" + " declared in protocol %1">, InGroup<DiagGroup<"objc-protocol-property-synthesis">>; def warn_no_autosynthesis_shared_ivar_property : Warning < "auto property synthesis will not synthesize property " diff --git a/clang/lib/Sema/SemaObjCProperty.cpp b/clang/lib/Sema/SemaObjCProperty.cpp index f70e84d7a06..78e774b39ff 100644 --- a/clang/lib/Sema/SemaObjCProperty.cpp +++ b/clang/lib/Sema/SemaObjCProperty.cpp @@ -1574,10 +1574,12 @@ void Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl* IMPDecl, } continue; } - if (isa<ObjCProtocolDecl>(Prop->getDeclContext())) { + if (ObjCProtocolDecl *Proto = + dyn_cast<ObjCProtocolDecl>(Prop->getDeclContext())) { // We won't auto-synthesize properties declared in protocols. Diag(IMPDecl->getLocation(), - diag::warn_auto_synthesizing_protocol_property); + diag::warn_auto_synthesizing_protocol_property) + << Prop << Proto; Diag(Prop->getLocation(), diag::note_property_declare); continue; } diff --git a/clang/test/SemaObjC/default-synthesize-3.m b/clang/test/SemaObjC/default-synthesize-3.m index 0275806dd0e..e409d216928 100644 --- a/clang/test/SemaObjC/default-synthesize-3.m +++ b/clang/test/SemaObjC/default-synthesize-3.m @@ -172,12 +172,12 @@ typedef NSObject<Fooing> FooObject; @interface Okay : NSObject<Fooing> @end -@implementation Okay // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}} +@implementation Okay // expected-warning {{auto property synthesis will not synthesize property 'muahahaha' declared in protocol 'Fooing'}} expected-warning {{auto property synthesis will not synthesize property 'hoho' declared in protocol 'SubFooling'}} @end @interface Fail : FooObject @end -@implementation Fail // expected-warning 2 {{auto property synthesis will not synthesize property declared in a protocol}} +@implementation Fail // expected-warning {{auto property synthesis will not synthesize property 'muahahaha' declared in protocol 'Fooing'}} expected-warning {{auto property synthesis will not synthesize property 'hoho' declared in protocol 'SubFooling'}} @end diff --git a/clang/test/SemaObjC/default-synthesize.m b/clang/test/SemaObjC/default-synthesize.m index dd16c1361d8..9356b9f5b3a 100644 --- a/clang/test/SemaObjC/default-synthesize.m +++ b/clang/test/SemaObjC/default-synthesize.m @@ -136,5 +136,5 @@ @interface MyClass <MyProtocol> @end -@implementation MyClass // expected-warning {{auto property synthesis will not synthesize property declared in a protocol}} +@implementation MyClass // expected-warning {{auto property synthesis will not synthesize property 'requiredString' declared in protocol 'MyProtocol'}} @end diff --git a/clang/test/SemaObjC/forward-protocol-incomplete-impl-warn.m b/clang/test/SemaObjC/forward-protocol-incomplete-impl-warn.m index c3efeba4f9e..654ef59f3d8 100644 --- a/clang/test/SemaObjC/forward-protocol-incomplete-impl-warn.m +++ b/clang/test/SemaObjC/forward-protocol-incomplete-impl-warn.m @@ -15,6 +15,6 @@ @interface IBImageCatalogDocument : NSObject <DVTInvalidation> // expected-note {{required for direct or indirect protocol 'DVTInvalidation'}} @end -@implementation IBImageCatalogDocument // expected-warning {{auto property synthesis will not synthesize property declared in a protocol}} \ +@implementation IBImageCatalogDocument // expected-warning {{auto property synthesis will not synthesize property 'Prop' declared in protocol 'DVTInvalidation'}} \ // expected-warning {{method 'invalidate' in protocol not implemented}} @end |