Ok. On Thu, Jun 7, 2018, 3:14 PM Marek Polacek <pola...@redhat.com> wrote:
> On Thu, Jun 07, 2018 at 03:51:24AM -0700, H.J. Lu wrote: > > On Wed, Jun 6, 2018 at 10:47 AM, Jason Merrill <ja...@redhat.com> wrote: > > > If we're going to allow it with a pedwarn, we shouldn't clobber the > > > decl with an error_mark_node. > > > > > > Tested x86_64-pc-linux-gnu, applying to trunk and 8. > > > > I got > > > > > /export/gnu/import/git/gcc-test/src-8/gcc/testsuite/g++.dg/cpp0x/range-for9.C:8:18: > > error: range-based 'for' loops only available with -std=c++11 or > > -std=gnu++11^M > > > /export/gnu/import/git/gcc-test/src-8/gcc/testsuite/g++.dg/cpp0x/range-for9.C:8:18: > > error: forming reference to reference type 'int (&)[3]'^M > > compiler exited with status 1 > > PASS: g++.dg/cpp0x/range-for9.C -std=c++98 (test for errors, line 8) > > FAIL: g++.dg/cpp0x/range-for9.C -std=c++98 (test for excess errors) > > Excess errors: > > > /export/gnu/import/git/gcc-test/src-8/gcc/testsuite/g++.dg/cpp0x/range-for9.C:8:18: > > error: forming reference to reference type 'int (&)[3]' > > Jason, ok to fix with this one? > > 2018-06-07 Marek Polacek <pola...@redhat.com> > > * g++.dg/cpp0x/range-for9.C: Adjust dg-error. > > --- gcc/testsuite/g++.dg/cpp0x/range-for9.C > +++ gcc/testsuite/g++.dg/cpp0x/range-for9.C > @@ -5,6 +5,6 @@ > void test() > { > int a[] = {0,1,2}; > - for (int x : a) // { dg-error "range-based 'for'" } > + for (int x : a) // { dg-error "range-based 'for'|forming reference" } > ; > } >