[all-commits] [llvm/llvm-project] 5c55f9: [Clang] Don't assume unexpanded PackExpansions' si...
Younan Zhang via All-commits
all-commits at lists.llvm.org
Wed Dec 18 21:12:22 PST 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 5c55f9664f7e2f9fe29589a97bc5818d6b8d3c9c
https://github.com/llvm/llvm-project/commit/5c55f9664f7e2f9fe29589a97bc5818d6b8d3c9c
Author: Younan Zhang <zyn7109 at gmail.com>
Date: 2024-12-19 (Thu, 19 Dec 2024)
Changed paths:
M clang/docs/ReleaseNotes.rst
M clang/include/clang/Basic/DiagnosticSemaKinds.td
M clang/lib/Sema/SemaTemplateVariadic.cpp
M clang/test/SemaTemplate/pack-deduction.cpp
Log Message:
-----------
[Clang] Don't assume unexpanded PackExpansions' size when expanding packs (#120380)
CheckParameterPacksForExpansion() previously assumed that template
arguments don't include PackExpansion types when attempting another pack
expansion (i.e. when NumExpansions is present). However, this assumption
doesn't hold for type aliases, whose substitution might involve
unexpanded packs. This can lead to incorrect diagnostics during
substitution because the pack size is not yet determined.
To address this, this patch calculates the minimum pack size (ignoring
unexpanded PackExpansionTypes) and compares it to the previously
expanded size. If the minimum pack size is smaller, then there's still a
chance for future substitution to expand it to a correct size, so we
don't diagnose it too eagerly.
Fixes #61415
Fixes #32252
Fixes #17042
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list