1 // RUN: %clang_cc1 %s -verify
2 // RUN: %clang_cc1 %s -verify=expected,space -Wcompound-token-split
4 // Ensure we get the same warnings after -frewrite-includes
5 // RUN: %clang_cc1 %s -E -frewrite-includes -o %t
6 // RUN: %clang_cc1 -x c++ %t -verify=expected,space -Wcompound-token-split
12 #define VAR(type, name, init) type name = (init)
15 VAR(int, x
, {}); // #1
16 // expected-warning@#1 {{'(' and '{' tokens introducing statement expression appear in different macro expansion contexts}}
17 // expected-note-re@#1 {{{{^}}'{' token is here}}
19 // FIXME: It would be nice to suppress this when we already warned about the opening '({'.
20 // expected-warning@#1 {{'}' and ')' tokens terminating statement expression appear in different macro expansion contexts}}
21 // expected-note-re@#1 {{{{^}}')' token is here}}
23 // expected-error@#1 {{cannot initialize a variable of type 'int' with an rvalue of type 'void'}}
29 int n
= ({ 1; }RPAREN
; // expected-warning {{'}' and ')' tokens terminating statement expression appear in different macro expansion contexts}} expected-note {{')' token is here}}
33 [ // space-warning-re {{{{^}}'[' tokens introducing attribute are separated by whitespace}}
38 [[noreturn
] ] void h(); // space-warning-re {{{{^}}']' tokens terminating attribute are separated by whitespace}}
41 int X:: *p
; // space-warning {{'::' and '*' tokens forming pointer to member type are separated by whitespace}}