[all-commits] [llvm/llvm-project] adb0d8: [Clang] Distinguish expanding-pack-in-place cases ...

Younan Zhang via All-commits all-commits at lists.llvm.org
Wed Nov 6 23:37:35 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: adb0d8ddceb143749c519d14b8b31b481071da77
      https://github.com/llvm/llvm-project/commit/adb0d8ddceb143749c519d14b8b31b481071da77
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-11-07 (Thu, 07 Nov 2024)

  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:
  -----------
  [Clang] Distinguish expanding-pack-in-place cases for SubstTemplateTypeParmTypes (#114220)

In 50e5411e4, we preserved the pack substitution index within
SubstTemplateTypeParmType nodes and performed in-place expansions of
packs such that type constraints on a lambda that serve as a pattern of
a fold expression could be evaluated if the type constraints contain any
packs that are expanded by the fold expression.

However, we made an incorrect assumption of the condition under which
in-place expansion should occur. For example, a SizeOfPackExpr case
relies on SubstTemplateTypeParmType nodes being transformed to
SubstTemplateTypeParmPackTypes rather than expanding them immediately in
place.

This fixes that by adding a flag to SubstTemplateTypeParmType to
discriminate such in-place expansion situations.

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



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