rjmccall wrote:

It's certainly possible to see push/pop pragmas in late-parsed code, but Sema 
should immediately emit an error and ignore them because, like I said, they're 
only allowed at file context, and AFAIK late-parsed code is never at file 
context.  If there's some sneaky way to late-parse file-context declarations, 
that seems like a serious problem, because it's very important to process 
pragmas in order as we parse the top level.  And contrariwise, if there's some 
sneaky way to put push/pop pragmas in non-file contexts, that also seems like a 
serious problem, because the way we process them is not designed to understand 
local scopes, which means we're just doing random stuff instead of implementing 
any sort of intelligible language design.

Now, I don't really mind the late-parsing code being overly cautious about 
things possibly pushing and popping on the pragma stack as long as it's not 
costing us a significant amount of performance, but it would also be fine for 
it to assert that that hasn't happened and then just save and restore the 
active state, which is the only thing that late parsing should ever touch.

https://github.com/llvm/llvm-project/pull/70646
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to