brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.0 KiB · 0b0c0b5 Raw
26 lines · cpp
1// RUN: not %clang_cc1 -std=c++2c -ast-dump %s | FileCheck  %s2 3namespace InvalidPacksShouldNotCrash {4 5struct NotAPack;6template <typename T, auto V, template<typename> typename Tp>7void 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}}14}15 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...{{.*}}'24 25}26