I looked back at my commit to see if I have any comments and now I can't 
remember why that needed to be there. The commit and the Radar are both about 
preserving attributes, not dropping them, so I'm not going to worry about this 
one.

Jordan


> On Dec 18, 2014, at 10:30 , Nico Weber <[email protected]> wrote:
> 
> (+Jordan as he wrote r176728)
> 
> On Wed, Dec 17, 2014 at 6:58 PM, Nico Weber <[email protected] 
> <mailto:[email protected]>> wrote:
> Don't drop attributes when checking explicit specializations.
> 
> Consider a template class with attributes on a method, and an explicit
> specialization of that method:
> 
>     template <int>
>     struct A {
>       void foo() final;
>     };
> 
>     template <>
>     void A<0>::foo() {}
> 
> In this example, the attribute is `final`, but it might also be an
> __attribute__((visibility("foo"))), noreturn, inline, etc. clang's current
> behavior is to strip all attributes, which for some attributes is wrong
> (the snippet above allows a subclass of A<0> to override the final method, for
> example) and for others disagrees with gcc (__attribute__((visibility()))).
> 
> So stop dropping attributes. r95845 added this code without a test case, and
> r176728 added the code for dropping attributes on parameters (with tests, but
> they still pass).
> 
> As an additional wrinkle, do drop dllimport and dllexport, since that's how 
> these two
> attributes work. (This is covered by existing tests.)
> 
> Fixes PR21942.
> 
> The approach is by Richard Smith, initial analysis and typing was done by me.
> 
> Nico
> 
> 

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

Reply via email to