1 // RUN: %clang_cc1 -fsyntax-only -verify -pedantic -std=c++98 %s
3 #define for 0 // expected-warning {{keyword is hidden by macro definition}}
15 #undef __cplusplus // expected-warning {{undefining builtin macro}}
18 // allowlisted definitions
31 #define inline __inline
33 #define inline __inline__
36 #define inline inline__ // expected-warning {{keyword is hidden by macro definition}}
38 #define extern __inline // expected-warning {{keyword is hidden by macro definition}}
40 #define extern __extern // expected-warning {{keyword is hidden by macro definition}}
42 #define extern __extern__ // expected-warning {{keyword is hidden by macro definition}}
45 #define inline _inline // expected-warning {{keyword is hidden by macro definition}}
47 #define volatile // expected-warning {{keyword is hidden by macro definition}}
50 #pragma clang diagnostic warning "-Wreserved-macro-identifier"
52 #define switch if // expected-warning {{keyword is hidden by macro definition}}
54 #define __HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
55 #define _HAVE_X 0 // expected-warning {{macro name is a reserved identifier}}
56 #define X__Y // expected-warning {{macro name is a reserved identifier}}
58 #undef __cplusplus // expected-warning {{macro name is a reserved identifier}}
59 #undef _HAVE_X // expected-warning {{macro name is a reserved identifier}}
60 #undef X__Y // expected-warning {{macro name is a reserved identifier}}