[all-commits] [llvm/llvm-project] 2c2d29: [concepts] Extract function template pack argument...

Younan Zhang via All-commits all-commits at lists.llvm.org
Mon Feb 5 17:59:28 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 2c2d291b4568381999442e47fc77f949f19be0bc
      https://github.com/llvm/llvm-project/commit/2c2d291b4568381999442e47fc77f949f19be0bc
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-02-06 (Tue, 06 Feb 2024)

  Changed paths:
    M clang/docs/ReleaseNotes.rst
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaTemplate/concepts-out-of-line-def.cpp

  Log Message:
  -----------
  [concepts] Extract function template pack arguments from the current instantiation if possible (#80594)

Before the constraint substitution, we employ
`getTemplateInstantiationArgs`, which in turn attempts to inspect
`TemplateArgument`s from the function template. For parameter packs from
their parent contexts, we used to extract the arguments from the
specialization type, in which could result in non-canonical argument
types e.g. `PackExpansionType`.

This may break the contract that, during a tree transformation, in
`TreeTransform::TryExpandParameterPacks`, the corresponding
`TemplateArgument`s for an `UnexpandedParameterPack` are expected to be
of `Pack` kinds if we're expanding template parameters.

Fixes https://github.com/llvm/llvm-project/issues/72557.




More information about the All-commits mailing list