This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [testsuite] fix use of dg-error/dg-warning in many C++ tests
On Thu, 2008-08-28 at 15:19 -0700, Janis Johnson wrote:
> On Tue, 2008-08-26 at 22:18 +0200, Manuel LÃpez-IbÃÃez wrote:
> > 2008/8/26 Janis Johnson <janis187@us.ibm.com>:
> > >>
> > >> > Index: gcc/testsuite/g++.dg/parse/defarg11.C
> > >> > ===================================================================
> > >> > --- gcc/testsuite/g++.dg/parse/defarg11.C (revision 139574)
> > >> > +++ gcc/testsuite/g++.dg/parse/defarg11.C (working copy)
> > >> > @@ -4,6 +4,6 @@
> > >> > class foo {
> > >> > public:
> > >> > void operator& (int = 1); // { dg-error "default argument" }
> > >> > - void operator++ (int = 2); // { dg-error "default argument" }
> > >> > - void operator-- (int = 3); // { dg-error "default argument" }
> > >> > + void operator++ (int = 2); // { dg-warning "default argument" }
> > >> > + void operator-- (int = 3); // { dg-warning "default argument" }
> > >> > };
> > >>
> > >> Is it a bit weird that two of those are warnings but one is an error?
> > >
> > > Probably, but that's what it really gets:
> > >
> > > g++.dg/parse/defarg11.C:6: error: 'void foo::operator&(int)' cannot have default arguments
> > > g++.dg/parse/defarg11.C:7: warning: 'void foo::operator++(int)' cannot have default arguments
> > > g++.dg/parse/defarg11.C:8: warning: 'void foo::operator--(int)' cannot have default arguments
> >
> > I think you found a regression. The two warnings should be permerrors,
> > that is, errors by default that can be downgraded to warnings by
> > -fpermissive. But let's see what a C++ maintainer says.
>
> When the test was added there were three errors reported with -pedantic,
> now there's one error and two warnings. The change happened between
> 20080130 and 20080327; when the reghunt is complete I'll file a PR.
>
> I'll drop this change from the patch, and when switching to the
> stricter dg-error/dg-warning I'll XFAIL the second two error checks.
On second thought, rather than submitting a PR I'll just point out
that the two errors changed to warnings with this patch:
http://gcc.gnu.org/viewcvs?view=rev&rev=132817
r132817 | manu | 2008-03-02 15:45:29 +0000 (Sun, 02 Mar 2008)
Janis