[all-commits] [llvm/llvm-project] bbd2a5: Revert "[Clang] Distinguish expanding-pack-in-plac...

Matheus Izvekov via All-commits all-commits at lists.llvm.org
Tue Apr 1 15:49:18 PDT 2025


  Branch: refs/heads/users/mizvekov/GH101754
  Home:   https://github.com/llvm/llvm-project
  Commit: bbd2a588f79926323a29a3a70f061e4a2433bdc2
      https://github.com/llvm/llvm-project/commit/bbd2a588f79926323a29a3a70f061e4a2433bdc2
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-04-01 (Tue, 01 Apr 2025)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/include/clang/AST/PropertiesBase.td
    M clang/include/clang/AST/Type.h
    M clang/include/clang/AST/TypeProperties.td
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/AST/ASTImporter.cpp
    M clang/lib/AST/Type.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/SemaCXX/cxx20-ctad-type-alias.cpp

  Log Message:
  -----------
  Revert "[Clang] Distinguish expanding-pack-in-place cases for SubstTemplateTypeParmTypes (#114220)"

This reverts commit adb0d8ddceb143749c519d14b8b31b481071da77.


  Commit: 28d2240a61c0765f3dc7b743d412deb55136cc18
      https://github.com/llvm/llvm-project/commit/28d2240a61c0765f3dc7b743d412deb55136cc18
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-04-01 (Tue, 01 Apr 2025)

  Changed paths:
    M clang/include/clang/Sema/Sema.h
    M clang/lib/Sema/SemaTemplate.cpp
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/lib/Sema/SemaType.cpp

  Log Message:
  -----------
  Revert "[Clang][Sema] Retain the expanding index for unevaluated type constraints (#109518)"

This reverts commit 50e5411e4247421fd606f0a206682fcdf0303ae3.


  Commit: 6ba9bbe5e302a5e68a74d3fa2bd8de0b6b90bbbc
      https://github.com/llvm/llvm-project/commit/6ba9bbe5e302a5e68a74d3fa2bd8de0b6b90bbbc
  Author: Matheus Izvekov <mizvekov at gmail.com>
  Date:   2025-04-01 (Tue, 01 Apr 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.

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


Compare: https://github.com/llvm/llvm-project/compare/a2a372d436c6...6ba9bbe5e302

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