[clang] [clang][Sema] fix crash on __type_pack_element with dependent packs (GH180307) (PR #180407)

via cfe-commits cfe-commits at lists.llvm.org
Mon Feb 9 03:11:08 PST 2026


================
@@ -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}}
----------------
Serosh-commits wrote:

Yeah u are right 

https://github.com/llvm/llvm-project/pull/180407


More information about the cfe-commits mailing list