<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">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.</div><div class=""><br class=""></div><div class="">Jordan</div><div class=""><br class=""></div><br class=""><div><blockquote type="cite" class=""><div class="">On Dec 18, 2014, at 10:30 , Nico Weber <<a href="mailto:thakis@chromium.org" class="">thakis@chromium.org</a>> wrote:</div><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">(+Jordan as he wrote r176728)</div><div class="gmail_extra"><br class=""><div class="gmail_quote">On Wed, Dec 17, 2014 at 6:58 PM, Nico Weber <span dir="ltr" class=""><<a href="mailto:thakis@chromium.org" target="_blank" class="">thakis@chromium.org</a>></span> wrote:<br class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr" class=""><div class="">Don't drop attributes when checking explicit specializations.</div><div class=""><br class=""></div><div class="">Consider a template class with attributes on a method, and an explicit</div><div class="">specialization of that method:</div><div class=""><br class=""></div><div class="">    template <int></div><div class="">    struct A {</div><div class="">      void foo() final;</div><div class="">    };</div><div class=""><br class=""></div><div class="">    template <></div><div class="">    void A<0>::foo() {}</div><div class=""><br class=""></div><div class="">In this example, the attribute is `final`, but it might also be an</div><div class="">__attribute__((visibility("foo"))), noreturn, inline, etc. clang's current</div><div class="">behavior is to strip all attributes, which for some attributes is wrong</div><div class="">(the snippet above allows a subclass of A<0> to override the final method, for</div><div class="">example) and for others disagrees with gcc (__attribute__((visibility()))).</div><div class=""><br class=""></div><div class="">So stop dropping attributes. r95845 added this code without a test case, and</div><div class="">r176728 added the code for dropping attributes on parameters (with tests, but</div><div class="">they still pass).</div><div class=""><br class=""></div><div class="">As an additional wrinkle, do drop dllimport and dllexport, since that's how these two</div><div class="">attributes work. (This is covered by existing tests.)</div><div class=""><br class=""></div><div class="">Fixes PR21942.</div><div class=""><br class=""></div><div class="">The approach is by Richard Smith, initial analysis and typing was done by me.</div><span class="HOEnZb"><font color="#888888" class=""><div class=""><br class=""></div><div class="">Nico</div><div class=""><br class=""></div></font></span></div>
</blockquote></div><br class=""></div>
</div></blockquote></div><br class=""></body></html>