attribute((visibility(“hidden”))) @interface I @end
In the first case, clang emits a nice fixit if the attribute is written before the class keyword, while putting the attribute after @interface makes clang print an ugly diagnostic.
Instead of just making that print a nice fixit too, what do you think about allowing attributes for @interfaces after the @interface keyword too?
I see no reason to introduce confusion about where to put attributes in an @interface. It's not like after the @interface is actually a good place to put attributes.
> it's
>
> class __attribute__((visibility("hidden"))) A {};
>
> but
>
> __attribute__((visibility("hidden"))) @interface I @end
>
> In the first case, clang emits a nice fixit if the attribute is written
before the class keyword, while putting the attribute after @interface
makes clang print an ugly diagnostic.
>
> Instead of just making that print a nice fixit too, what do you think
about allowing attributes for @interfaces after the @interface keyword too?
I see no reason to introduce confusion about where to put attributes in an @interface. It's not like after the @interface is actually a good place to
put attributes.
Ok. The attached patch gives attributes after an objc directive a nicer
diagnostic then. Is this ok?