https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60875
Nikita Kniazev <nok.raven at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |nok.raven at gmail dot com --- Comment #4 from Nikita Kniazev <nok.raven at gmail dot com> --- Is this forbidden by the standard? The Clang and MSVC are fine with such pragma usage. It really complicates warning suppression. int main() { return #pragma GCC diagnostic push 42; } <source>: In function 'int main()': <source>:4:9: error: '#pragma' is not allowed here 4 | #pragma GCC diagnostic push | ^~~ <source>:4:12: error: expected ';' before numeric constant 4 | #pragma GCC diagnostic push | ^ | ; 5 | 42; | ~~ https://godbolt.org/z/mT1h0Z