[cfe-commits] [patch][3.2] Visibility cleanup and fixes

Rafael Espíndola rafael.espindola at gmail.com
Wed Apr 18 19:11:24 PDT 2012


> * In a similar way, the attribute in the method bar wins in both A<H>
> and A<D> in the following cases:
>
>   template <class T> struct HIDDEN A {
>     static void DEFAULT bar();
>   };
>   struct HIDDEN H;
>   struct DEFAULT D;
>
> Currently clang produces a default symbol for A<D> and a hidden one
> for A<H>. gcc 4.7 has the same problem:
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52995.

John asked on IRC why H doesn't override the visibility. My argument
is that H can make a template instantiation hidden, but from that
point we handle it as a regular type. With the template out of the
way, the above example becomes

struct HIDDEN A_H {
  static void DEFAULT bar();
};

and since we produce a default symbol for bar in this case, so should
the symbol in the template case be default.

Cheers,
Rafael




More information about the cfe-commits mailing list