https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70811
Martin Sebor <msebor at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Keywords| |diagnostic, rejects-valid Known to fail| |4.9.3, 5.3.0, 6.0 --- Comment #2 from Martin Sebor <msebor at gcc dot gnu.org> --- G++ gives several errors. The first one is more meaningful than the one issued by GCC. The rest suggest it's too confused to gracefully recover. FWIW, I wonder if it would be worth adding a c-c++ Component to Bugzilla for reports that affect both front ends but that might need a separate fix in each. (Not sure if this is one such case but I know there are some.) $ cat -n v.c && /home/msebor/build/gcc-trunk-git/gcc/xgcc -B/home/msebor/build/gcc-trunk-git/gcc -S -Wall -Wextra -Wpedantic -xc++ v.c 1 enum E 2 { 3 #pragma GCC diagnostic push 4 e 5 }; v.c:3:9: error: ‘#pragma’ is not allowed here #pragma GCC diagnostic push ^~~ v.c:4:5: error: expected ‘}’ before ‘e’ e ^ v.c:5:3: error: expected initializer before ‘}’ token }; ^ v.c:5:3: error: expected declaration before ‘}’ token