r176303 - objective-C: clang, following gcc, warns on

Jordan Rose jordan_rose at apple.com
Thu Feb 28 15:03:12 PST 2013


On Feb 28, 2013, at 14:36 , Fariborz Jahanian <fjahanian at apple.com> wrote:

> Author: fjahanian
> Date: Thu Feb 28 16:36:31 2013
> New Revision: 176303
> 
> URL: http://llvm.org/viewvc/llvm-project?rev=176303&view=rev
> Log:
> objective-C: clang, following gcc, warns on
> use of stand-alone protocol as type and uses
> id<proto>. Modify warning to say what compiler 
> is doing. // rdar//13158394
> 
> Modified:
>    cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
>    cfe/trunk/test/FixIt/fixit-objc.m
>    cfe/trunk/test/Parser/placeholder-recovery.m
>    cfe/trunk/test/SemaObjC/protocol-archane.m
> 
> Modified: cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td?rev=176303&r1=176302&r2=176303&view=diff
> ==============================================================================
> --- cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td (original)
> +++ cfe/trunk/include/clang/Basic/DiagnosticParseKinds.td Thu Feb 28 16:36:31 2013
> @@ -363,7 +363,7 @@ def note_objc_container_start : Note<
>   "%select{class|protocol|category|class extension|implementation"
>   "|category implementation}0 started here">;
> def warn_objc_protocol_qualifier_missing_id : Warning<
> -  "protocol qualifiers without 'id' is archaic">;
> +  "property has no object type specified; defaults to qualified 'id'">;

"property"? Your test case is a local variable. Was that supposed to be "protocol"?


> def err_objc_unknown_at : Error<"expected an Objective-C directive after '@'">;
> def err_illegal_super_cast : Error<
>   "cannot cast 'super' (it isn't an expression)">;
> 
> Modified: cfe/trunk/test/FixIt/fixit-objc.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/FixIt/fixit-objc.m?rev=176303&r1=176302&r2=176303&view=diff
> ==============================================================================
> --- cfe/trunk/test/FixIt/fixit-objc.m (original)
> +++ cfe/trunk/test/FixIt/fixit-objc.m Thu Feb 28 16:36:31 2013
> @@ -11,7 +11,7 @@
> @protocol X;
> 
> void foo() {
> -  <X> *P;    // expected-warning{{protocol qualifiers without 'id' is archaic}}
> +  <X> *P;    // expected-warning{{property has no object type specified; defaults to qualified 'id'}}
> }
> 
> @class A;
> 
> Modified: cfe/trunk/test/Parser/placeholder-recovery.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/Parser/placeholder-recovery.m?rev=176303&r1=176302&r2=176303&view=diff
> ==============================================================================
> --- cfe/trunk/test/Parser/placeholder-recovery.m (original)
> +++ cfe/trunk/test/Parser/placeholder-recovery.m Thu Feb 28 16:36:31 2013
> @@ -5,7 +5,7 @@
> // bogus 'archaic' warnings with bad location info.
> @protocol <#protocol name#> <NSObject> // expected-error 2{{expected identifier}} \
> // expected-error{{cannot find protocol declaration for 'NSObject'}} \
> -// expected-warning{{protocol qualifiers without 'id'}}
> +// expected-warning{{property has no object type specified; defaults to qualified 'id'}}
> 
> <#methods#>  // expected-error{{expected identifier}}
> 
> 
> Modified: cfe/trunk/test/SemaObjC/protocol-archane.m
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/protocol-archane.m?rev=176303&r1=176302&r2=176303&view=diff
> ==============================================================================
> --- cfe/trunk/test/SemaObjC/protocol-archane.m (original)
> +++ cfe/trunk/test/SemaObjC/protocol-archane.m Thu Feb 28 16:36:31 2013
> @@ -8,9 +8,9 @@
> void bar();
> void foo(id x) {
>   bar((short<SomeProtocol>)x); // expected-error {{expected ')'}} expected-note {{to match this '('}}
> -  bar((<SomeProtocol>)x);      // expected-warning {{protocol qualifiers without 'id' is archaic}}
> +  bar((<SomeProtocol>)x);      // expected-warning {{property has no object type specified; defaults to qualified 'id'}}
> 
> -  [(<SomeProtocol>)x bar];      // expected-warning {{protocol qualifiers without 'id' is archaic}}
> +  [(<SomeProtocol>)x bar];      // expected-warning {{property has no object type specified; defaults to qualified 'id'}}
> }
> 
> @protocol MyProtocol
> @@ -37,6 +37,6 @@ Class <SomeProtocol> UnfortunateGCCExten
> @protocol Broken @end
> @interface Crash @end
> @implementation Crash
> -- (void)crashWith:(<Broken>)a { // expected-warning {{protocol qualifiers without 'id' is archaic}}
> +- (void)crashWith:(<Broken>)a { // expected-warning {{property has no object type specified; defaults to qualified 'id'}}
> }
> @end
> 
> 
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20130228/e1539ae2/attachment.html>


More information about the cfe-commits mailing list