[all-commits] [llvm/llvm-project] 6b4f7c: [clang] Concepts: support pack expansions for type...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Mon Mar 24 05:20:18 PDT 2025


  Branch: refs/heads/users/mizvekov/GH101754
  Home:   https://github.com/llvm/llvm-project
  Commit: 6b4f7cb8797c23de164bd7172e1988ddd7787fff
      https://github.com/llvm/llvm-project/commit/6b4f7cb8797c23de164bd7172e1988ddd7787fff
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-03-24 (Mon, 24 Mar 2025)

  Changed paths:
    M clang-tools-extra/clang-tidy/modernize/UseConstraintsCheck.cpp
    M clang/docs/ReleaseNotes.rst
    M clang/include/clang/AST/ASTConcept.h
    M clang/include/clang/AST/Decl.h
    M clang/include/clang/AST/DeclTemplate.h
    M clang/include/clang/Sema/Sema.h
    M clang/include/clang/Sema/SemaConcept.h
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/DeclTemplate.cpp
    M clang/lib/Sema/SemaCodeComplete.cpp
    M clang/lib/Sema/SemaConcept.cpp
    M clang/lib/Sema/SemaDecl.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaOverload.cpp
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateDeduction.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Serialization/ASTReaderDecl.cpp
    M clang/lib/Serialization/ASTWriterDecl.cpp
    M clang/test/SemaCXX/fold_lambda_with_variadics.cpp
    M clang/unittests/AST/SourceLocationTest.cpp

  Log Message:
  -----------
  [clang] Concepts: support pack expansions for type constraints

This reverts an earlier attempt to support these expansions,
which was limited to type arguments and which subverted the purpose
of SubstTemplateTypeParmType.

This propagates the ArgumentPackSubstitutionIndex along with the
AssociatedConstraint, so that the pack expansion works, without
needing any new transforms or otherwise any changes to the template
instanntiation process.

This keeps the tests from the reverted commits, and adds a few more
showing the new solution also works for NTTPs.

This patch is incomplete:
* It is likely missing plumbing the ArgumentPackSubstitutionIndex
  into more places.
* The Normalization cache is not adapted so it indexes on the
  ArgumentPackSubstitutionIndex as well.

One new test is added, which in any case shows an ambiguous call,
but if the normalization cache were corrected, the reason for
ambighuity would change from subsumption both ways, to neither
subsumes the other.

I am not sure if the current language rules would allow
for a test case where the pack index would break an ambiguity,
this is left for future consideration.



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