The attached test case failed with gcc 4.9 and older, but started compiling successfully with only the 1 expected warning with gcc 5. Adding it to the test suite would ensure that this behavior doesn't regress. Note that I have only tested it by compiling it manually, and not by actually running it as part of the entire test suite, so please let me know if I got any of the dejagnu directives wrong.
Thanks, Eric Gallager gcc/testsuite/ChangeLog: 2017-03-24 Eric Gallager <eg...@gwmail.gwu.edu> * gcc.dg/pragma-diag-7.c: New test.
/* { dg-do compile } */ unsigned long ok = 0UL; #pragma GCC diagnostic push #pragma GCC diagnostic warning "-Wtraditional" unsigned long bad = 1UL; /* { dg-warning "suffix" } */ /* Note the extra space before the pragma on this next line: */ #pragma GCC diagnostic pop unsigned long ok_again = 2UL; /* { dg-bogus "suffix" } */