[cfe-commits] [patch][PR11797] Call ActOnFinishNamespaceDef before consumeClose
Rafael Ávila de Espíndola
rafael.espindola at gmail.com
Fri Jan 20 06:03:33 PST 2012
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
More information about the cfe-commits
mailing list