https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89808
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic Status|UNCONFIRMED |NEW Last reconfirmed| |2019-03-25 Component|c++ |preprocessor Version|unknown |8.3.1 Ever confirmed|0 |1 Severity|normal |enhancement --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- Testcase: #pragma once int main() {} > g++ t.C -S t.C:1:9: warning: #pragma once in main file #pragma once ^~~~ you could work around this by wrapping the pragma in a preprocessor conditional