1 // RUN: not %clang_cc1 -fsyntax-only %s 2>&1 | FileCheck %s -strict-whitespace
3 #define NO_INITIATION(x) int a = x * 2
4 #define NO_DEFINITION(x) int c = x * 2
9 // CHECK: {{.*}}:6:15: warning: variable 'a' is uninitialized when used within its own initialization
10 // CHECK-NEXT: NO_INITIATION(a);
11 // CHECK-NEXT: ~~~~~~~~~~~~~~^~
12 // CHECK-NEXT: {{.*}}:3:34: note: expanded from macro 'NO_INITIATION'
13 // CHECK-NEXT: #define NO_INITIATION(x) int a = x * 2
16 // CHECK: {{.*}}:7:15: error: use of undeclared identifier 'b'
17 // CHECK-NEXT: NO_DEFINITION(b);
22 #define ADD(x,y) y + F(x)
23 #define SWAP_ARGU(x,y) ADD(y,x)
25 int p
= SWAP_ARGU(3, x
);
27 // CHECK: {{.*}}:25:23: error: use of undeclared identifier 'x'
28 // CHECK-NEXT: int p = SWAP_ARGU(3, x);
31 #define APPLY(f,x,y) x f y
38 int r
= APPLY(+,ff
,1);
39 // CHECK: {{.*}}:38:15: error: invalid operands to binary expression ('node' and 'int')
40 // CHECK-NEXT: int r = APPLY(+,ff,1);
42 // CHECK-NEXT: {{.*}}:31:24: note: expanded from macro 'APPLY'
43 // CHECK-NEXT: #define APPLY(f,x,y) x f y