Daniel Dunbar | a572887 | 2009-12-15 20:14:24 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s |
Steve Naroff | b4eaf9c | 2008-09-02 18:50:17 +0000 | [diff] [blame] | 2 | |
| 3 | // The preprocessor shouldn't warn about extensions within macro bodies that |
| 4 | // aren't expanded. |
Eli Friedman | eb32fde | 2009-04-28 03:13:54 +0000 | [diff] [blame] | 5 | #define TY typeof |
| 6 | #define TY1 typeof(1) |
Steve Naroff | b4eaf9c | 2008-09-02 18:50:17 +0000 | [diff] [blame] | 7 | |
Eli Friedman | eb32fde | 2009-04-28 03:13:54 +0000 | [diff] [blame] | 8 | // But we should warn here |
| 9 | TY1 x; // expected-warning {{extension}} |
| 10 | TY(1) x; // FIXME: And we should warn here |
| 11 | |
| 12 | // Note: this warning intentionally doesn't trigger on keywords like |
| 13 | // __attribute; the standard allows implementation-defined extensions |
| 14 | // prefixed with "__". |
| 15 | // Current list of keywords this can trigger on: |
| 16 | // inline, restrict, asm, typeof, _asm |
Steve Naroff | b4eaf9c | 2008-09-02 18:50:17 +0000 | [diff] [blame] | 17 | |
| 18 | void whatever() {} |