https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84127
Jakub Jelinek <jakub at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |jakub at gcc dot gnu.org --- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> --- I don't see what kind of change you are talking about, except that the -Wexpansion-to-defined warning has been added in 7.x. The reason why the GCC diagnostic ignore pragma works for this warning in C and doesn't in C++ is that in C++ we preprocess/tokenize everything first and only then start parsing it. The pragmas are handled while parsing stuff, after all the preprocessing and thus also preprocessor diagnostics is emitted. To handle what you want would require that we handle GCC diagnostic pragmas twice, once during preprocessing using preprocessor tokenization infrastructure first and then once again after the preprocessing.