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

Oliver Hunt via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 11 19:51:03 PST 2026


================
@@ -3459,15 +3463,12 @@ static QualType checkBuiltinTemplateIdType(
   }
 
   case BTK__type_pack_element: {
-    // Specializations of
-    //    __type_pack_element<Index, T_1, ..., T_N>
-    // are treated like T_Index.
     assert(Converted.size() == 2 &&
            "__type_pack_element should be given an index and a parameter pack");
+    if (Converted[0].isDependent() || Converted[1].isDependent())
----------------
ojhunt wrote:

I think these lifted dependence checks are due to removing the attempt to do the checks universally prior to the switch, so they should just be reverted.

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


More information about the cfe-commits mailing list