1*0e00a95bSRichard Smith // RUN: %clang_cc1 %s -verify 2*0e00a95bSRichard Smith // RUN: %clang_cc1 %s -verify=expected,space -Wcompound-token-split 3*0e00a95bSRichard Smith // RUN: %clang_cc1 %s -verify=expected,space -Wall 4*0e00a95bSRichard Smith 5*0e00a95bSRichard Smith #ifdef LSQUARE 6*0e00a95bSRichard Smith [ // expected-note {{second '[' token is here}} 7*0e00a95bSRichard Smith #else 8*0e00a95bSRichard Smith 9*0e00a95bSRichard Smith #define VAR(type, name, init) type name = (init) 10*0e00a95bSRichard Smith 11*0e00a95bSRichard Smith void f() { 12*0e00a95bSRichard Smith VAR(int, x, {}); // #1 13*0e00a95bSRichard Smith // expected-warning@#1 {{'(' and '{' tokens introducing statement expression appear in different macro expansion contexts}} 14*0e00a95bSRichard Smith // expected-note-re@#1 {{{{^}}'{' token is here}} 15*0e00a95bSRichard Smith // 16*0e00a95bSRichard Smith // FIXME: It would be nice to suppress this when we already warned about the opening '({'. 17*0e00a95bSRichard Smith // expected-warning@#1 {{'}' and ')' tokens terminating statement expression appear in different macro expansion contexts}} 18*0e00a95bSRichard Smith // expected-note-re@#1 {{{{^}}')' token is here}} 19*0e00a95bSRichard Smith // 20*0e00a95bSRichard Smith // expected-error@#1 {{cannot initialize a variable of type 'int' with an rvalue of type 'void'}} 21*0e00a95bSRichard Smith } 22*0e00a95bSRichard Smith 23*0e00a95bSRichard Smith #define RPAREN ) 24*0e00a95bSRichard Smith 25*0e00a95bSRichard Smith int f2() { 26*0e00a95bSRichard Smith int n = ({ 1; }RPAREN; // expected-warning {{'}' and ')' tokens terminating statement expression appear in different macro expansion contexts}} expected-note {{')' token is here}} 27*0e00a95bSRichard Smith return n; 28*0e00a95bSRichard Smith } 29*0e00a95bSRichard Smith 30*0e00a95bSRichard Smith [ // expected-warning-re {{{{^}}'[' tokens introducing attribute appear in different source files}} 31*0e00a95bSRichard Smith #define LSQUARE 32*0e00a95bSRichard Smith #include __FILE__ 33*0e00a95bSRichard Smith noreturn ]] void g(); 34*0e00a95bSRichard Smith 35*0e00a95bSRichard Smith [[noreturn] ] void h(); // space-warning-re {{{{^}}']' tokens terminating attribute are separated by whitespace}} 36*0e00a95bSRichard Smith 37*0e00a95bSRichard Smith struct X {}; 38*0e00a95bSRichard Smith int X:: *p; // space-warning {{'::' and '*' tokens forming pointer to member type are separated by whitespace}} 39*0e00a95bSRichard Smith 40*0e00a95bSRichard Smith #endif 41