xref: /aosp_15_r20/external/clang/test/Preprocessor/extension-warning.c (revision 67e74705e28f6214e480b399dd47ea732279e315)
1*67e74705SXin Li // RUN: %clang_cc1 -fsyntax-only -verify -pedantic %s
2*67e74705SXin Li 
3*67e74705SXin Li // The preprocessor shouldn't warn about extensions within macro bodies that
4*67e74705SXin Li // aren't expanded.
5*67e74705SXin Li #define TY typeof
6*67e74705SXin Li #define TY1 typeof(1)
7*67e74705SXin Li 
8*67e74705SXin Li // But we should warn here
9*67e74705SXin Li TY1 x; // expected-warning {{extension}}
10*67e74705SXin Li TY(1) x; // FIXME: And we should warn here
11*67e74705SXin Li 
12*67e74705SXin Li // Note: this warning intentionally doesn't trigger on keywords like
13*67e74705SXin Li // __attribute; the standard allows implementation-defined extensions
14*67e74705SXin Li // prefixed with "__".
15*67e74705SXin Li // Current list of keywords this can trigger on:
16*67e74705SXin Li // inline, restrict, asm, typeof, _asm
17*67e74705SXin Li 
whatever()18*67e74705SXin Li void whatever() {}
19