21 lines · c
1// RUN: %clang_cc1 %s -Eonly -verify2 3#pragma GCC poison rindex4rindex(some_string, 'h'); // expected-error {{attempt to use a poisoned identifier}}5 6#define BAR _Pragma ("GCC poison XYZW") XYZW /*NO ERROR*/7 XYZW // ok8BAR9 XYZW // expected-error {{attempt to use a poisoned identifier}}10 11// Pragma poison shouldn't warn from macro expansions defined before the token12// is poisoned.13 14#define strrchr rindex215#pragma GCC poison rindex216 17// Can poison multiple times.18#pragma GCC poison rindex219 20strrchr(some_string, 'h'); // ok.21