[all-commits] [llvm/llvm-project] c08b80: [Clang] Remove the PackExpansion restrictions for ...

Younan Zhang via All-commits all-commits at lists.llvm.org
Thu Feb 13 23:26:14 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: c08b80eb525a6e6a34d74634bf5181f11ed12984
      https://github.com/llvm/llvm-project/commit/c08b80eb525a6e6a34d74634bf5181f11ed12984
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2025-02-14 (Fri, 14 Feb 2025)

  Changed paths:
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/AST/ast-dump-ctad-alias.cpp

  Log Message:
  -----------
  [Clang] Remove the PackExpansion restrictions for rewrite substitution (#126206)

When substituting for rewrite purposes, as in rebuilding constraints for
a synthesized deduction guide, it assumed that packs were in
PackExpansion* form, such that the instantiator could extract a pattern.
    
For type aliases CTAD, while rebuilding their associated constraints,
this might not be the case because we'll call
`TransformTemplateArgument()` for the alias template arguments, where
there might be cases e.g. a non-pack expansion type into a pack
expansion, so the assumption wouldn't hold.
    
This patch fixes that by making it treat the non-pack expansions as
direct patterns when rewriting.

Fixes #124715



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