]> git.ipfire.org Git - thirdparty/gcc.git/commit
c++: decltype of capture proxy of ref [PR115504]
authorPatrick Palka <ppalka@redhat.com>
Wed, 26 Jun 2024 00:07:15 +0000 (20:07 -0400)
committerPatrick Palka <ppalka@redhat.com>
Wed, 26 Jun 2024 00:07:15 +0000 (20:07 -0400)
commit737449e5f233feb682b5dd2cc153892ad90a79bd
treeae0837172adba2c96f72f7b7f10fedc4d882b54a
parent3e64a687a303dd550df072676c853d79076de37f
c++: decltype of capture proxy of ref [PR115504]

The finish_decltype_type capture proxy handling added in r14-5330 was
incorrectly stripping references in the type of the captured variable.

PR c++/115504

gcc/cp/ChangeLog:

* semantics.cc (finish_decltype_type): Don't strip the reference
type (if any) of a capture proxy's captured variable.

gcc/testsuite/ChangeLog:

* g++.dg/cpp1y/decltype-auto8.C: New test.

Reviewed-by: Jason Merrill <jason@redhat.com>
gcc/cp/semantics.cc
gcc/testsuite/g++.dg/cpp1y/decltype-auto8.C [new file with mode: 0644]