[cfe-commits] [patch] Improve how we compute visualities

Rafael Espíndola rafael.espindola at gmail.com
Sun Apr 15 06:11:48 PDT 2012


(fixing the list address)

2012/4/15 Rafael Espíndola <rafael.espindola at gmail.com>:
> Chandler has been pushing me to make our visibility computation more
> principled, and I think this patch finally does it.
>
> It splits the visibility computation in three steps. First we consider
> things that can force the visibility to be hidden or default, like an
> attribute in the decl itself. We then consider -fvisibility hidden and
> then cases that can only reduce the visibility, like attributes on
> types.
>
> Out behaviour changes in
>
>    template <class T> struct HIDDEN A {
>      static void DEFAULT bar();
>    };
>    struct HIDDEN H;
>    struct DEFAULT D;
>
> It doesn't really make sense for H to make A<H> "more hidden" than
> A<D>. Our behaviour also changes in
>
>    template<typename T>
>    class DEFAULT bar {
>      void zed() {}
>    };
>    struct HIDDEN xyz {
>    };
>    template class bar<xyz>;
>
> Where we were missing the opportunity of making bar<xyz> hidden.
>
> GCC 4.7 has recently regressed in this area (or I am missing
> something). I reported
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52995 and will keep track
> in case we need to update something in clang.
>
> Cheers,
> Rafael




More information about the cfe-commits mailing list