[all-commits] [llvm/llvm-project] 8ce204: [Clang][Sema] Avoid pack expansion for expanded em...

Younan Zhang via All-commits all-commits at lists.llvm.org
Mon May 20 18:47:26 PDT 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8ce2045be0ce708af0bfce5dc14632fa15dc743a
      https://github.com/llvm/llvm-project/commit/8ce2045be0ce708af0bfce5dc14632fa15dc743a
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2024-05-21 (Tue, 21 May 2024)

  Changed paths:
    M clang/include/clang/AST/ExprCXX.h
    M clang/lib/AST/ExprCXX.cpp
    M clang/lib/Sema/SemaTemplateVariadic.cpp
    M clang/lib/Sema/TreeTransform.h
    M clang/lib/Serialization/ASTReaderStmt.cpp
    M clang/lib/Serialization/ASTWriterStmt.cpp
    M clang/test/PCH/pack_indexing.cpp
    M clang/test/SemaCXX/cxx2c-pack-indexing.cpp

  Log Message:
  -----------
  [Clang][Sema] Avoid pack expansion for expanded empty PackIndexingExprs (#92385)

We previously doubled the id-expression expansion, even when the pack
was expanded to empty. The previous condition for determining whether we
should expand couldn't distinguish between cases where 'the expansion
was previously postponed' and 'the expansion occurred but resulted in
emptiness.'

In the latter scenario, we crash because we have not been examining the
current lambda's parent local instantiation scope since
[D98068](https://reviews.llvm.org/D98068): Any Decls instantiated in the
parent scope are not visible to the generic lambda, and thus any attempt
of looking for instantiated Decls in the lambda is capped to the current
Lambda's LIS.

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



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