[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ast-dump-pack-indexing-crash.cpp
blob0b0c0b572b5e6360e277d059ef918f00c11a46de
1 // RUN: not %clang_cc1 -std=c++2c -ast-dump %s | FileCheck %s
3 namespace InvalidPacksShouldNotCrash {
5 struct NotAPack;
6 template <typename T, auto V, template<typename> typename Tp>
7 void not_pack() {
8 int i = 0;
9 i...[0]; // expected-error {{i does not refer to the name of a parameter pack}}
10 V...[0]; // expected-error {{V does not refer to the name of a parameter pack}}
11 NotAPack...[0] a; // expected-error{{'NotAPack' does not refer to the name of a parameter pack}}
12 T...[0] b; // expected-error{{'T' does not refer to the name of a parameter pack}}
13 Tp...[0] c; // expected-error{{'Tp' does not refer to the name of a parameter pack}}
16 // CHECK: FunctionDecl {{.*}} not_pack 'void ()'
17 // CHECK: DeclStmt {{.*}}
18 // CHECK: DeclStmt {{.*}}
19 // CHECK-NEXT: VarDecl {{.*}} a 'NotAPack...{{.*}}'
20 // CHECK-NEXT: DeclStmt {{.*}}
21 // CHECK-NEXT: VarDecl {{.*}} 'T...{{.*}}'
22 // CHECK-NEXT: DeclStmt {{.*}}
23 // CHECK-NEXT: VarDecl {{.*}} c 'Tp...{{.*}}'