https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113631
Richard Biener <rguenth at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Last reconfirmed| |2024-01-29 Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Version|unknown |14.0 --- Comment #1 from Richard Biener <rguenth at gcc dot gnu.org> --- <source>:1:2: error: expected ';' before 'typedef' 1 | a a.h:1:9: error: expected '=', ',', ';', 'asm' or '__attribute__' before '#pragma' 1 | #pragma message "foo" | ^~~~~~~ as it's a different message it's likely using a different location to highlight the issue. In general it's difficult to tell whether pointing to the first token sequence in the #included file or the last token before the #include directive is better here. Of course the pragma location should underline either #pragma or the whole #pragma, not just 'message'. Btw, same issue without the #include: a #pragma message "foo" vs. a typedef int b; I'm not sure it makes sense to special case the situation we've switched files?