c++: pruning non-captures in noexcept lambda [PR119764]
The patch for PR87185 fixed the ICE without fixing the underlying problem,
that we were failing to find the declaration of the capture proxy that we
are trying to decide whether to prune. Fixed by looking at the right index
in stmt_list_stack.
Since this changes captures, it changes the ABI of noexcept lambdas; we
haven't worked hard to maintain lambda capture ABI, but it's easy enough to
control here.
PR c++/119764
PR c++/87185
gcc/cp/ChangeLog:
* lambda.cc (insert_capture_proxy): Handle noexcept lambda.
(prune_lambda_captures): Likewise, in ABI v21.
gcc/testsuite/ChangeLog:
* g++.dg/cpp0x/lambda/lambda-noexcept1.C: New test.