1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++17 %s
2 // RUN: not %clang_cc1 -ast-dump %s -std=c++17 | FileCheck %s
5 while(!!!) // expected-error {{expected expression}}
8 // CHECK: RecoveryExpr {{.*}} <line:{{.*}}:9, col:11> 'bool'
9 // CHECK: whileBody 'int'
11 for(!!!) // expected-error {{expected expression}} expected-error {{expected ';'}}
14 // FIXME: the AST should have a RecoveryExpr to distinguish from for(;;)
15 // CHECK-NOT: RecoveryExpr
16 // CHECK: forBody 'int'
18 for(auto c
: !!!) // expected-error {{expected expression}}
20 // FIXME: parse the foreach body
21 // CHECK-NOT: CXXForRangeStmt
22 // CHECK-NOT: forEachBody 'int'
26 while(!!!); // expected-error {{expected expression}}
28 // CHECK: doBody 'int'
29 // CHECK: RecoveryExpr {{.*}} <line:{{.*}}:9, col:11> 'bool'
31 if(!!!) // expected-error {{expected expression}}
36 // CHECK: RecoveryExpr {{.*}} <line:{{.*}}:6, col:8> 'bool'
37 // CHECK: ifBody 'int'
38 // CHECK: elseBody 'int'
40 switch(!!!) // expected-error {{expected expression}}
43 // CHECK: RecoveryExpr {{.*}} <line:{{.*}}:10, col:12> 'int'
44 // CHECK: switchBody 'int'
46 switch (;) // expected-error {{expected expression}}
50 // CHECK: RecoveryExpr {{.*}} <col:11> 'int'
51 // CHECK: switchBody 'int'
53 switch (;;) // expected-error {{expected expression}}
57 // CHECK: RecoveryExpr {{.*}} <col:11, col:12> 'int'
58 // CHECK: switchBody 'int'
60 switch (!!!;) // expected-error {{expected expression}}
63 // CHECK: RecoveryExpr {{.*}} <line:{{.*}}:11, col:14> 'int'
64 // CHECK: switchBody 'int'