c++: prvalue of array type [PR111286]
commitc7e8381748f78335e9fef23f363b6a9e4463ce7e
authorJason Merrill <jason@redhat.com>
Mon, 5 Feb 2024 18:54:22 +0000 (5 13:54 -0500)
committerJason Merrill <jason@redhat.com>
Mon, 5 Feb 2024 21:32:15 +0000 (5 16:32 -0500)
tree3d7efefb78d0e2b044eac99a3c157166882bd810
parentf1412546ac8999b7f6eeeee8cf967ce3f31794c2
c++: prvalue of array type [PR111286]

Here we want to build a prvalue array to bind to the T reference, but we
were wrongly trying to strip cv-quals from the array prvalue, which should
be treated the same as a class prvalue.

PR c++/111286

gcc/cp/ChangeLog:

* tree.cc (rvalue): Don't drop cv-quals from an array.

gcc/testsuite/ChangeLog:

* g++.dg/cpp0x/initlist-array22.C: New test.
gcc/cp/tree.cc
gcc/testsuite/g++.dg/cpp0x/initlist-array22.C [new file with mode: 0644]