Now with the patch :-(

2012/4/22 Rafael Espíndola <[email protected]>:
> Given
>
> namespace t1 {
>  template<typename T>
>  class DEFAULT foo {
>    void bar() {}
>  };
>  struct HIDDEN zed {
>  };
>  template class DEFAULT foo<zed>;
> }
> namespace t2 {
>  template<typename T>
>  class DEFAULT foo {
>    void bar() {}
>  };
>  struct HIDDEN zed {
>  };
>  template class foo<zed>;
> }
>
> gcc 4.7 produces a default symbol for the first test and a hidden one
> for the second one. This requires differentiating attributes in a
> template and attributes in an instantiation. Clang currently doesn't
> do that for any attributes, but Jeff tells me that "C++11 just says
> that attributes appertain to particular things, not how they propagate
> from templates to instantiations" so this looks like a valid c++
> extension by gcc.
>
> The attached patch:
>
> * Avoids cloning the visibility attribute during instantiations.
> * Avoids considering visibility info in a template when the
> instantiation has an attribute. This lets us get the first testcase
> right.
> * Goes back to selecting the minimum visibility in cases where we
> should look at the template visibility. This lets us get the second
> testcase right.
>
> The summary is that this fixes cases where where we were being
> unnecessary conservative in producing a default visibility but avoids
> breaking chrome's build.
>
> Cheers,
> Rafael

Attachment: t.patch
Description: Binary data

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

Reply via email to