[patch] Don't drop attributes when checking explicit specializations.

John McCall rjmccall at apple.com
Fri Dec 19 13:58:16 PST 2014


> On Dec 19, 2014, at 12:58 PM, Reid Kleckner <rnk at google.com> wrote:
> 
> I think it's more interesting when the specialization lacks attributes:
> 
>     template <int>
>     struct A { void __attribute__((visibility("hidden"))) foo() {} };
>     template <> void A<0>::foo() {} // implicitly default visibility
>  
>     // compile with -fvisibility=hidden
>     template <int>
>     struct A { void __attribute__((visibility("default"))) foo() {} };
>     template <> void A<0>::foo() {} // implicitly hidden visibility
> 
> I'm fine with this if there's no behavior change here.

Eh.  I think this should probably be considered to have explicit default visibility in the absence of an overriding attribute.

John.



More information about the cfe-commits mailing list