[PATCH] c++: Implement C++23 P0849R8 - auto(x) [PR103049]
Marek Polacek
polacek@redhat.com
Thu Nov 18 23:03:21 GMT 2021
On Thu, Nov 18, 2021 at 05:36:45PM -0500, Jason Merrill wrote:
> On 11/4/21 16:26, Marek Polacek wrote:
> > This patch implements P0849R8 which allows auto in a functional cast,
> > the result of which is a prvalue.
> >
> > [expr.type.conv]/1 says that the type is determined by placeholder type
> > deduction. We only accept 'auto', not 'decltype(auto)' -- that the
> > type shall be auto comes from [dcl.type.auto.deduct]. Therefore the
> > rules are like for [temp.deduct.call], deducing template arguments from
> > a function call, so the result type will never be a reference, and we
> > decay arrays/functions.
> >
> > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk?
>
> OK.
Running dg.exp again, I noticed
FAIL: g++.dg/cpp0x/auto9.C -std=c++23 (test for errors, line 48)
which I'd missed before, but that was an obvious fix, so I fixed it
and pushed the patch, thanks!
Marek
More information about the Gcc-patches
mailing list