c++: location of lambda object and conversion call
authorJason Merrill <jason@redhat.com>
Mon, 15 Nov 2021 04:18:19 +0000 (23:18 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 15 Nov 2021 07:52:36 +0000 (02:52 -0500)
commit2317082c151e5580e0bfe5fcfbd0e9d0172446c9
tree69059807d9ebc4345c55559282dec9b7519db46f
parent37326651b439bac55d96fb5a43f4daf25e401eda
c++: location of lambda object and conversion call

Two things that had poor location info: we weren't giving the TARGET_EXPR
for a lambda object any location, and the call to a conversion function was
getting whatever input_location happened to be.

gcc/cp/ChangeLog:

* call.c (perform_implicit_conversion_flags): Use the location of
the argument.
* lambda.c (build_lambda_object): Set location on the TARGET_EXPR.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/lambda/lambda-switch.C: Adjust expected location.
gcc/cp/call.c
gcc/cp/lambda.c
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-switch.C