freebsd-src/contrib/llvm-project
Dimitry Andric feb5b0c76f Merge commit 158f4f30adb4 from llvm git (by Corentin Jabot):
[Clang] Do not change the type of captured vars when checking lambda constraints

  When checking the constraint of a lambda, we need to respect the constness
  of the call operator when establishing the type of capture variables.

  In D124351, this was done by adding const to the captured variable...
  However, that would change the type of the variable outside of the scope
  of the lambda, which is clearly not the desired outcome.

  Instead, to ensure const-correctness, we need to populate
  a LambdaScopeInfo with the capture variables before checking the
  constraints of a generic lambda.

  There is no changelog as I'd like to tentatively propose we backport
  this change to RC3 as it is a regression introduced in the Clang 17
  cycle.

  Fixes #61267

  Reviewed By: aaron.ballman, #clang-language-wg

  Differential Revision: https://reviews.llvm.org/D158433

Merge commit 3ed9e9e3ace6 from llvm git (by Corentin Jabot):

  [Clang] Add captures to the instantiation scope of lambda call operators

  Like concepts checking, a trailing return type of a lambda
  in a dependent context may refer to captures in which case
  they may need to be rebuilt, so the map of local decl
  should include captures.

  This patch reveal a pre-existing issue.
  `this` is always recomputed by TreeTransform.

  `*this` (like all captures) only become `const`
  after the parameter list.

  However, if try to recompute the value of `this` (in a parameter)
  during template instantiation while determining the type of the call operator,
  we will determine  it to be const (unless the lambda is mutable).

  There is no good way to know at that point that we are in a parameter
  or not, the easiest/best solution is to transform the type of this.

  Note that doing so break a handful of HLSL tests.
  So this is a prototype at this point.

  Fixes #65067
  Fixes #63675

  Reviewed By: erichkeane

  Differential Revision: https://reviews.llvm.org/D159126

This fixes 'Assertion failed: (isa<LabelDecl>(D) && "declaration not
instantiated in this scope"), function findInstantiationOf' error when
building databases/mongodb44.

PR:		273753
MFC after:	1 month
2023-12-08 18:36:06 +01:00
..
clang Merge commit 158f4f30adb4 from llvm git (by Corentin Jabot): 2023-12-08 18:36:06 +01:00
compiler-rt Merge llvm-project release/17.x llvmorg-17.0.0-rc4-10-g0176e8729ea4 2023-12-08 18:35:11 +01:00
libcxx Merge llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367 2023-12-08 18:35:59 +01:00
libunwind Merge llvm-project release/17.x llvmorg-17.0.0-rc4-10-g0176e8729ea4 2023-12-08 18:35:11 +01:00
lld Merge llvm-project release/17.x llvmorg-17.0.3-0-g888437e1b600 2023-12-08 18:35:41 +01:00
lldb Merge llvm-project release/17.x llvmorg-17.0.0-rc4-10-g0176e8729ea4 2023-12-08 18:35:11 +01:00
llvm Merge llvm-project release/17.x llvmorg-17.0.6-0-g6009708b4367 2023-12-08 18:35:59 +01:00
openmp Merge llvm-project release/17.x llvmorg-17.0.5-0-g98bfdac5ce82 2023-12-08 18:35:50 +01:00
FREEBSD-Xlist Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00