[Clang] Fix evaluation of parameters of lambda call operator attributes
authorCorentin Jabot <corentinjabot@gmail.com>
Tue, 21 Mar 2023 15:57:43 +0000 (16:57 +0100)
committerCorentin Jabot <corentinjabot@gmail.com>
Thu, 23 Mar 2023 15:11:58 +0000 (16:11 +0100)
commit82c83d7e41053b72fc0dc84de9b8bee71986ffc3
tree1481ce1e80a6ea52ff7fd47fb1df0049f91e5a15
parent5bcb4c4da99c443fb880d408e5ff4e9b305bbb77
[Clang] Fix evaluation of parameters of lambda call operator attributes

Fix a regresion introduced by D124351.
Attributes of lambda call operator were evaluated in the
context of the closure object type rather than its operator,
causing an assertion failure.

This was because we temporarily switch to the class lambda to
produce the mangling of the lambda, but we stayed in that
context too long.

Reviewed By: eandrews, aaron.ballman

Differential Revision: https://reviews.llvm.org/D146535
clang/lib/Sema/SemaLambda.cpp
clang/test/SemaCXX/lambda-expressions.cpp