Skip to content
Snippets Groups Projects
Commit 4b2726a6 authored by Jakub Jelinek's avatar Jakub Jelinek Committed by Jakub Jelinek
Browse files

c++: Fix up pedwarn for capturing structured bindings in lambdas [PR118719]

As mentioned in the PR, this pedwarni is desirable for the implicit or
explicit capturing of structured bindings in C++17, but in the case of
init-captures the initializer is just some expression and that can include
structured bindings.

So, the following patch limits the warning to non-explicit_init_p.

2025-02-04  Jakub Jelinek  <jakub@redhat.com>

	PR c++/118719
	* lambda.cc (add_capture): Only pedwarn about capturing structured
	binding if !explicit_init_p.

	* g++.dg/cpp1z/decomp63.C: New test.
parent 4c98b382
No related branches found
No related tags found
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment