spavloff wrote:

`pragma pack` uses pragma stack and it is allowed in any place: 
https://godbolt.org/z/f8fP1vn63 . If such pragma presents in the late-parsed 
template, and push-pop operations in it are not balanced, the late parse of 
such function can break the pragma stack and next templates can be parsed 
incorrectly. It is not a FP pragma, but it demonstrates that the compiler must 
provide some Sema state isolation for late parsed templates.

For floating-point pragmas the stack could be cleared once, before the late 
parsing takes place. However it is complicated by the fact that the pragma 
stack set in precompiled header must be available in the unit that uses the 
header. Another complication is implicit assumption in some places that the 
default FP options are defined by LangOpts. It is not true, in some cases 
target may modify the default state (i386 is an example).

This fix is not optimal. The problems mentioned above are solvable and they 
should be fixed. However to have a quick solution for the initial PR the fix 
probably could be used.


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