diff options
author | Younan Zhang <zyn7109@gmail.com> | 2025-10-03 14:17:15 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-10-03 06:17:15 +0000 |
commit | e0eb7c25cbb5b5b80f023b1e3cc0b31e1bdaa8f0 (patch) | |
tree | 375cc7cd212f84e7b07ce261e98460fd9adec2b4 /llvm/lib/Support/StringMap.cpp | |
parent | a7016c43daa30b9517042b4f87b11787fa76ae30 (diff) | |
download | llvm-e0eb7c25cbb5b5b80f023b1e3cc0b31e1bdaa8f0.zip llvm-e0eb7c25cbb5b5b80f023b1e3cc0b31e1bdaa8f0.tar.gz llvm-e0eb7c25cbb5b5b80f023b1e3cc0b31e1bdaa8f0.tar.bz2 |
[Clang] Ensure initialized NTTP expressions when building CTAD for type aliases (#161035)
We missed calling CheckTemplateArgument when building CTAD deduction
guides. That ensures some InitExprs are correctly initialized, as in the
test that crashed due to incorrect NTTP initialization.
I don't use CheckTemplateArguments because, in CTAD synthesis, template
parameter packs don't always appear at the end of the parameter list,
unlike user-written ones mandated by the standard. This makes it
difficult for CheckTemplateArguments to determine how many arguments a
pack in middle should match, leading to unnecessary complexity.
On the other hand, since we substitute non-deduced template parameters
with deduced ones, we need to fold the packs midway through
substitution, where CheckTemplateArgument is more convenient.
As a drive-by this also removes some dead code in SemaInit.
Fixes #131408
Diffstat (limited to 'llvm/lib/Support/StringMap.cpp')
0 files changed, 0 insertions, 0 deletions