On 20/01/12 12:40 AM, Richard Smith wrote:
> Perhaps it's time to review the handling of #pragma visibility. The existing
> mechanism is very flaky -- this is the second subtle bug we've had with it in
> recent months (the previous bug, which probably can still be observed in some
> cases, is that lookahead / tentative parsing which looks past such a #pragma
> applies its effects immediately).
> 
> In what positions does gcc permit this pragma to appear? Could we produce a
> token for it, and consume that token (and activate the change to the default
> visibility) when parsing a declaration?

As far as I can tell, gcc will accept it anywhere :-(

One thing I was considering trying as a followup patch was rejecting
things like

namespace std __attribute__ ((__visibility__ ("default"))) {
#pragma GCC visibility push(default)
}

Since it is really hard to imagine a reasonable meaning to give it.

I will take a look at moving the side effect from the lexer to the parser.

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

Reply via email to