[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ast-dump-using.cpp
blob8e5c60d3aabf4a8f639b260d6e9f645a468f399d
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -ast-dump %s | FileCheck -strict-whitespace %s
3 namespace a {
4 struct S;
5 template <typename T> T x = {};
7 namespace b {
8 using a::S;
9 // CHECK: UsingDecl {{.*}} a::S
10 // CHECK-NEXT: | `-NestedNameSpecifier Namespace {{.*}} 'a'
11 // CHECK-NEXT: UsingShadowDecl {{.*}} implicit CXXRecord {{.*}} 'S'
12 // CHECK-NEXT: `-RecordType {{.*}} 'a::S'
13 typedef S f; // to dump the introduced type
14 // CHECK: TypedefDecl
15 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S' sugar
16 // CHECK-NEXT: `-UsingType [[TYPE_ADDR:.*]] 'a::S' sugar
17 // CHECK-NEXT: |-UsingShadow [[SHADOW_ADDR:.*]] 'S'
18 // CHECK-NEXT: `-RecordType {{.*}} 'a::S'
19 typedef S e; // check the same UsingType is reused.
20 // CHECK: TypedefDecl
21 // CHECK-NEXT: `-ElaboratedType {{.*}} 'S' sugar
22 // CHECK-NEXT: `-UsingType [[TYPE_ADDR]] 'a::S' sugar
23 // CHECK-NEXT: |-UsingShadow [[SHADOW_ADDR]] 'S'
24 // CHECK-NEXT: `-RecordType {{.*}} 'a::S'
25 using a::x;
27 void foo() {
28 x<int> = 3;
29 // CHECK: DeclRefExpr {{.*}} 'x' {{.*}} (UsingShadow {{.*}} 'x')