gcc/testsuite/c-c++-common/pr69558-1.c
raw| 1 | /* PR c/69558 */ |
| 2 | /* { dg-do compile } */ |
| 3 | /* { dg-options "-Wdeprecated-declarations" } */ |
| 4 | |
| 5 | /* Verify disabling -Wdeprecated-declarations, where the _Pragma is in a |
| 6 | macro, but the affected code is *not* in a macro. */ |
| 7 | |
| 8 | #define A \ |
| 9 | _Pragma ("GCC diagnostic push") \ |
| 10 | _Pragma ("GCC diagnostic ignored \"-Wdeprecated-declarations\"") |
| 11 | #define B \ |
| 12 | _Pragma ("GCC diagnostic pop") |
| 13 | |
| 14 | __attribute__((deprecated)) void foo (void); |
| 15 | |
| 16 | void bar (void) |
| 17 | { |
| 18 | A |
| 19 | foo (); |
| 20 | B |
| 21 | } |