1 // RUN: %clang_cc1 %s -E -verify -DOPERATOR_NAMES
2 // RUN: %clang_cc1 %s -E -verify -fno-operator-names
5 //expected-error@+3 {{token is not a valid binary operator in a preprocessor subexpression}}
7 // Valid because 'and' is a spelling of '&&'
8 #if defined foo and bar
11 // Not valid in C++ unless -fno-operator-names is passed:
14 //expected-error@+2 {{C++ operator 'and' (aka '&&') used as a macro name}}
19 //expected-error@+2 {{C++ operator 'xor' (aka '^') used as a macro name}}
24 // For error recovery we continue as though the identifier was a macro name regardless of -fno-operator-names.
26 //expected-error@+3 {{C++ operator 'and' (aka '&&') used as a macro name}}
28 //expected-warning@+2 {{and is defined}}
30 #warning and is defined
34 //expected-error@+2 {{invalid token at start of a preprocessor expression}}
40 //expected-error@+2 {{invalid token at start of a preprocessor expression}}