================ @@ -0,0 +1,24 @@ +// RUN: not %clang_cc1 -std=c++2c -ast-dump %s | FileCheck %s + +namespace InvalidPacksShouldNotCrash { + +struct NotAPack; +template <typename T, auto V, template<typename> typename Tp> +void not_pack() { + int i = 0; + i...[0]; // expected-error {{i does not refer to the name of a parameter pack}} + V...[0]; // expected-error {{V does not refer to the name of a parameter pack}} + NotAPack...[0] a; // expected-error{{'NotAPack' does not refer to the name of a parameter pack}} + T...[0] b; // expected-error{{'T' does not refer to the name of a parameter pack}} + Tp...[0] c; // expected-error{{'Tp' does not refer to the name of a parameter pack}} +} + +// CHECK: -FunctionDecl {{.*}} not_pack 'void ()' +// CHECK: |-DeclStmt {{.*}} ---------------- erichkeane wrote:
Instead of testing the spaces/`-` and `|-` character, just use 'CHECK-NEXT`. Else this can get fraigle due to WS. Else the test looks fine. https://github.com/llvm/llvm-project/pull/80439 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits