| 1 |
// RUN: %clang_cc1 -verify -ast-dump %s | FileCheck %s |
| 2 |
|
| 3 |
extern void foo(Unknown*); // expected-error {{unknown type name 'Unknown'}} |
| 4 |
|
| 5 |
namespace a { |
| 6 |
void computeSomething() { |
| 7 |
foo(new Unknown()); // expected-error {{unknown type name 'Unknown'}} |
| 8 |
foo(new Unknown{}); // expected-error {{unknown type name 'Unknown'}} |
| 9 |
foo(new Unknown); // expected-error {{unknown type name 'Unknown'}} |
| 10 |
} |
| 11 |
} // namespace a |
| 12 |
|
| 13 |
namespace b { |
| 14 |
struct Bar{}; |
| 15 |
} // namespace b |
| 16 |
|
| 17 |
// CHECK: |-NamespaceDecl 0x{{[^ ]*}} <line:5:1, line:11:1> line:5:11 a |
| 18 |
// CHECK-NEXT: | `-FunctionDecl 0x{{[^ ]*}} <line:6:3, line:10:3> line:6:8 computeSomething 'void ()' |
| 19 |
// CHECK-NEXT: | `-CompoundStmt 0x{{[^ ]*}} <col:27, line:10:3> |
| 20 |
// CHECK-NEXT: | |-RecoveryExpr {{.*}} '<dependent type>' contains-errors |
| 21 |
// CHECK-NEXT: | | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo' |
| 22 |
// CHECK-NEXT: | |-RecoveryExpr {{.*}} '<dependent type>' contains-errors |
| 23 |
// CHECK-NEXT: | | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo' |
| 24 |
// CHECK-NEXT: | `-RecoveryExpr {{.*}} '<dependent type>' contains-errors |
| 25 |
// CHECK-NEXT: | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo' |
| 26 |
// CHECK-NEXT: |-NamespaceDecl 0x{{[^ ]*}} <line:13:1, line:15:1> line:13:11 b |
| 27 |
// CHECK-NEXT: | `-CXXRecordDecl 0x{{[^ ]*}} <line:14:3, col:14> col:10 referenced struct Bar definition |
| 28 |
|
| 29 |
static b::Bar bar; |
| 30 |
// CHECK: `-VarDecl 0x{{[^ ]*}} <line:29:1, col:15> col:15 bar 'b::Bar' static callinit |
| 31 |
// CHECK-NEXT: `-CXXConstructExpr 0x{{[^ ]*}} <col:15> 'b::Bar' 'void () noexcept' |