[patch] Fix mismatched #pragma GCC visibility

Rafael Ávila de Espíndola rafael.espindola@gmail.com
Wed Jan 25 03:18:00 GMT 2012


> While we can change it, it is certainly valid as is, #pragma GCC visibility
> can happen in lots of places and just marks where the default visibility
> is adjusted.  If clang errors on this, it is broken.

It doesn't. As far as I can tell, in the absence of templates clang
produces the same results as gcc on any valid case. I was trying to
improve the error messages and found this.

Just to make sure I get the more fun corner cases right. This is invalid:

-------------------------------------
#pragma GCC visibility push(default)

namespace foo __attribute__((visibility("hidden"))) {
  int a;
#pragma GCC visibility pop
  int b;
}
--------------------------------------

But removing the attribute makes it valid. Correct?

> 	Jakub

Cheers,
Rafael



More information about the Gcc-patches mailing list