[C++20] Determine the dependency of unevaluated lambdas more accurately
authorLiming Liu <gangliugangliu.ml@outlook.com>
Fri, 6 Jan 2023 13:56:25 +0000 (05:56 -0800)
committerErich Keane <erich.keane@intel.com>
Fri, 6 Jan 2023 13:56:25 +0000 (05:56 -0800)
commit051cc460ba9117c9f62c09235bdf6f5ae1248dd4
tree3a6f3fa56607bd6ed452029c35021a5fbe4da96f
parentb7ef63af566287c724d8883bcf715cb156a0c73f
[C++20] Determine the dependency of unevaluated lambdas more accurately

During template instantiation, the instantiator will enter constant
evaluated
context before instantiate a template argument originated from an
expression,
and this impedes the instantiator from creating lambdas with independent
types.

This patch solves the problem via widening the condition that the
instantiator
marks lambdas as never dependent, and fixes the issue #57960

Differential Revision: https://reviews.llvm.org/D140554
clang/docs/ReleaseNotes.rst
clang/include/clang/Sema/Sema.h
clang/lib/Sema/TreeTransform.h
clang/test/CodeGenCXX/cxx20-unevaluated-lambda-crash.cpp [new file with mode: 0644]
clang/test/SemaCXX/lambda-unevaluated.cpp