================
@@ -43,3 +43,8 @@ static_assert(__is_same(__type_pack_element<5, X<0>, X<1>, 
X<2>, X<3>, X<4>, X<5
 template <SizeT Index, typename ...T>
 using ErrorTypePackElement1 = __type_pack_element<Index, T...>; // 
expected-error{{may not be accessed at an out of bounds index}}
 using illformed1 = ErrorTypePackElement1<3, X<0>, X<1>>;  // expected-note{{in 
instantiation}}
+
+template <SizeT... Seq>
+void gh180307(__type_pack_element<Seq...>) {}
+
+using gh180307_empty = __type_pack_element<0>; // expected-error {{a parameter 
pack may not be accessed at an out of bounds index}}
----------------
ojhunt wrote:

We're adding more generic defense against incorrect builtin templates, it might 
be worth actually just making a separate test 
`clang/test/SemaCXX/builtin_templates_invalid_parameters.cpp` or something

https://github.com/llvm/llvm-project/pull/180407
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to