[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 08:05:13 PST 2026
================
@@ -3406,6 +3406,10 @@ static QualType checkBuiltinTemplateIdType(
Sema &SemaRef, ElaboratedTypeKeyword Keyword, BuiltinTemplateDecl *BTD,
ArrayRef<TemplateArgument> Converted, SourceLocation TemplateLoc,
TemplateArgumentListInfo &TemplateArgs) {
+ if (llvm::any_of(Converted,
+ [](const TemplateArgument &A) { return A.isDependent(); }))
+ return QualType();
----------------
Serosh-commits wrote:
> __make_integer_seq seems to tolerate dependent types, so it seems this change is too aggressive?
nice i was thinking that too @cor3ntin the global check was definitely too aggressive. i have moved the dependency checks into the cases and limited the __make_integer_seq check to just the sequence length. this keeps the eager expansion working for dependent templates and types and i also have added a test case to verify this specifically let me know if it is right
https://github.com/llvm/llvm-project/pull/180407
More information about the cfe-commits
mailing list