On Apr 3, 2013, at 3:00 PM, Nico Weber <[email protected]> wrote:

> Thanks for the review! Replies below:
> 
> On Wed, Apr 3, 2013 at 2:56 PM, jahanian <[email protected]> wrote:
> 
> On Apr 3, 2013, at 2:46 PM, Nico Weber <[email protected]> wrote:
> 
>> Hi,
>> 
>> the attached patch changes the attributes diag I added earlier today from
>> 
>>   test2.mm:3:12: error: postfix attributes are not allowed on Objective-C 
>> directives
>> 
>> to 
>> 
>>   test2.mm:3:12: error: postfix attributes are not allowed on Objective-C 
>> directives, place them in front of '@interface'
>> 
>> for @interface and @protocol (and keeps the diagnostic as is for @class and 
>> @implementation).
> 
> What is the rational for hint for @interface/@protocol and not others ?
> 
> Prefix attributes must be followed by interface or protocol; clang will diag 
> on __attribute__ in front of @class and @implementation. So suggesting to 
> move the attribute their seems wrong.
>  
> -@implementation EXP I @end // expected-error {{postfix attributes are not 
> allowed on Objective-C directives}}
> +@implementation EXP I @end // expected-error-re {{postfix attributes are not 
> allowed on Objective-C directives$}}
>                                                                               
> ????                                                                          
>               ??????
> 
> expected-error-re checks for a regular expression instead of just a string. 
> The "$" matched "end of line", this is done to check that there's nothing 
> following the word "directives" in the diag. (Since expected-error only 
> checks for substring matches.)

Good to know thanks.

>  
> -@class EXP OC; // expected-error {{postfix attributes are not allowed on 
> Objective-C directives}}
> +@class EXP OC; // expected-error-re {{postfix attributes are not allowed on 
> Objective-C directives$}}
> 
> These don’t look right.
> 
> Also, why can’t you pass the token down instead of adding and using "enum 
> ObjCAttrSkipHint”?
> 
> Seemed cleaner to me, I can pass the token instead if you like that better.

Yes please. No point in defining a new enum. With that, lgtm.
- Fariborz


_______________________________________________
cfe-commits mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits

Reply via email to