[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / AST / ast-dump-using-enum.cpp
blob26cf9e335e83a1b3d98aa6d1b58fa48bf3626293
1 // RUN: %clang_cc1 -triple x86_64-unknown-unknown -std=c++20 -ast-dump -ast-dump-filter Foo %s | FileCheck -strict-whitespace %s
3 // Test with serialization:
4 // RUN: %clang_cc1 -std=c++20 -triple x86_64-unknown-unknown -emit-pch -o %t %s
5 // RUN: %clang_cc1 -x c++ -std=c++20 -triple x86_64-unknown-unknown -include-pch %t \
6 // RUN: -ast-dump-all -ast-dump-filter Foo /dev/null \
7 // RUN: | FileCheck --strict-whitespace %s
9 namespace Bob {
10 enum class Foo {
11 Foo_a,
12 Foo_b
14 }; // namespace Bob
16 using enum Bob::Foo;
18 // CHECK-LABEL: Dumping Bob::Foo
19 // CHECK-NEXT: EnumDecl {{.*}} class Foo 'int'
20 // CHECK-NEXT: |-EnumConstantDecl {{.*}} Foo_a 'Bob::Foo'
21 // CHECK-NEXT: `-EnumConstantDecl {{.*}} Foo_b 'Bob::Foo'
23 // CHECK-LABEL: Dumping Foo:
24 // CHECK-NEXT: UsingEnumDecl {{.*}} <{{.*}}:16:1, col:17> {{.*}} Enum {{.*}} 'Foo'
26 // CHECK-LABEL: Dumping Foo_a:
27 // CHECK-NEXT: UsingShadowDecl {{.*}} implicit EnumConstant {{.*}} 'Foo_a' 'Bob::Foo'
29 // CHECK-LABEL: Dumping Foo_b:
30 // CHECK-NEXT: UsingShadowDecl {{.*}} implicit EnumConstant {{.*}} 'Foo_b' 'Bob::Foo'