[all-commits] [llvm/llvm-project] d919b8: [Clang] Handle instantiating captures in addInstan...

Younan Zhang via All-commits all-commits at lists.llvm.org
Tue Feb 25 08:30:55 PST 2025


  Branch: refs/heads/release/20.x
  Home:   https://github.com/llvm/llvm-project
  Commit: d919b8d97b12c24a13e1e92aa66ef1421e20104b
      https://github.com/llvm/llvm-project/commit/d919b8d97b12c24a13e1e92aa66ef1421e20104b
  Author: Younan Zhang <zyn7109 at gmail.com>
  Date:   2025-02-25 (Tue, 25 Feb 2025)

  Changed paths:
    M clang/lib/Sema/SemaConcept.cpp
    M clang/test/SemaTemplate/concepts-lambda.cpp

  Log Message:
  -----------
  [Clang] Handle instantiating captures in addInstantiatedCapturesToScope() (#128478)

addInstantiatedCapturesToScope() might be called when transforming a
lambda body. In this situation, it would look into all the lambda's
parents and figure out all the instantiated captures. However, the
instantiated captures are not visible from lambda's class decl until the
lambda is rebuilt (i.e. after the lambda body transform). So this patch
corrects that by also examining the LambdaScopeInfo, serving as a
workaround for not having deferred lambda body instantiation in Clang
20, to avoid regressing some real-world use cases.

Fixes #128175

(cherry picked from commit ecc7e6ce4cd57a614985e95daf7027918cb8723e)



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