brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.6 KiB · 9d6b19a Raw
32 lines · cpp
1// RUN: %clang_cc1 -verify -ast-dump %s | FileCheck %s2 3extern void foo(Unknown*); // expected-error {{unknown type name 'Unknown'}}4 5namespace 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 a12 13namespace b {14  struct Bar{};15} // namespace b16 17// CHECK:      |-NamespaceDecl 0x{{[^ ]*}} <line:5:1, line:11:1> line:5:11 a18// 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-errors21// CHECK-NEXT: |   | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo'22// CHECK-NEXT: |   |-RecoveryExpr {{.*}} '<dependent type>' contains-errors23// CHECK-NEXT: |   | `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo'24// CHECK-NEXT: |   `-RecoveryExpr {{.*}} '<dependent type>' contains-errors25// CHECK-NEXT: |    `-UnresolvedLookupExpr {{.*}} '<overloaded function type>' lvalue (ADL) = 'foo'26// CHECK-NEXT: |-NamespaceDecl 0x{{[^ ]*}} <line:13:1, line:15:1> line:13:11 b27// CHECK-NEXT: | `-CXXRecordDecl 0x{{[^ ]*}} <line:14:3, col:14> col:10 referenced struct Bar definition28 29static b::Bar bar;30// CHECK:      `-VarDecl 0x{{[^ ]*}} <line:29:1, col:15> col:15 bar 'b::Bar' static callinit31// CHECK-NEXT:   `-CXXConstructExpr 0x{{[^ ]*}} <col:15> 'b::Bar' 'void () noexcept'32