[clang] Handle __declspec() attributes in using
[llvm-project.git] / clang / test / AST / ast-dump-expr-errors.cpp
blob5661a41465eb63708d612787c611cafa30b332c5
1 // RUN: not %clang_cc1 -triple x86_64-unknown-unknown -Wno-unused-value -fcxx-exceptions -std=gnu++17 -ast-dump -frecovery-ast %s | FileCheck -strict-whitespace %s
3 // Check errors flag is set for RecoveryExpr.
4 //
5 // CHECK: VarDecl {{.*}} a
6 // CHECK-NEXT:`-RecoveryExpr {{.*}} contains-errors
7 // CHECK-NEXT: `-UnresolvedLookupExpr {{.*}} 'bar'
8 int a = bar();
10 // The flag propagates through more complicated calls.
12 // CHECK: VarDecl {{.*}} b
13 // CHECK-NEXT:`-CallExpr {{.*}} contains-errors
14 // CHECK-NEXT: |-UnresolvedLookupExpr {{.*}} 'bar'
15 // CHECK-NEXT: |-RecoveryExpr {{.*}} contains-errors
16 // CHECK-NEXT: | `-UnresolvedLookupExpr {{.*}} 'baz'
17 // CHECK-NEXT: `-RecoveryExpr {{.*}} contains-errors
18 // CHECK-NEXT: `-UnresolvedLookupExpr {{.*}} 'qux'
19 int b = bar(baz(), qux());
21 // Also propagates through more complicated expressions.
23 // CHECK: |-VarDecl {{.*}} c
24 // CHECK-NEXT:| `-BinaryOperator {{.*}} '<dependent type>' contains-errors '*'
25 // CHECK-NEXT:| |-UnaryOperator {{.*}} '<dependent type>' contains-errors prefix '&'
26 // CHECK-NEXT:| | `-ParenExpr {{.*}} '<dependent type>' contains-errors
27 // CHECK-NEXT:| | `-BinaryOperator {{.*}} '<dependent type>' contains-errors '+'
28 // CHECK-NEXT:| | |-RecoveryExpr {{.*}} '<dependent type>' contains-errors
29 // CHECK-NEXT:| | | `-UnresolvedLookupExpr {{.*}} 'bar'
30 // CHECK-NEXT:| | `-RecoveryExpr {{.*}} '<dependent type>' contains-errors
31 // CHECK-NEXT:| | `-UnresolvedLookupExpr {{.*}} 'baz'
32 int c = &(bar() + baz()) * 10;
34 // Errors flag propagates even when type is not dependent anymore.
35 // CHECK: |-VarDecl {{.*}} d
36 // CHECK-NEXT:| `-CXXStaticCastExpr {{.*}} 'int' contains-errors
37 // CHECK-NEXT:| `-BinaryOperator {{.*}} '<dependent type>' contains-errors '+'
38 // CHECK-NEXT:| |-RecoveryExpr {{.*}} '<dependent type>' contains-errors
39 // CHECK-NEXT:| | `-UnresolvedLookupExpr {{.*}} 'bar'
40 // CHECK-NEXT:| `-IntegerLiteral {{.*}} 1
41 int d = static_cast<int>(bar() + 1);
44 // Error type should result in an invalid decl.
45 // CHECK: -VarDecl {{.*}} invalid f 'decltype(<recovery-expr>(bar))'
46 decltype(bar()) f;