[testsuite] fix use of dg-error/dg-warning in many C++ tests

Manuel López-Ibáñez lopezibanez@gmail.com
Wed Aug 27 22:53:00 GMT 2008


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.

Cheers,

Manuel.



More information about the Gcc-patches mailing list