Commit 90a9a216 by Dirk Mueller Committed by Dirk Mueller

warnings2.C: Don't use -pedantic.

2007-03-22  Dirk Mueller  <dmueller@suse.de>

        * g++.old-deja/g++.brendan/warnings2.C: Don't use -pedantic.
        * g++.dg/other/static1.C: Remove stray semicolon.
        * g++.dg/other/init1.C: Likewise.
        * g++.dg/rtti/dyncast1.C: Likewise.
        * g++.dg/tree-ssa/pr17153.C: Likewise.
        * g++.dg/lookup/disamb1.C: Likewise.
        * g++.dg/lookup/scoped2.C: Likewise.
        * g++.dg/lookup/friend7.C: Likewise.
        * g++.dg/parse/parse4.C: Likewise.
        * g++.dg/parse/parse5.C: Likewise.
        * g++.dg/expr/pr29066.C: Likewise.
        * g++.dg/expr/cast4.C: Likewise.
        * g++.dg/tc1/dr193.C: Likewise.
        * g++.dg/tc1/dr213.C: Likewise.
        * g++.dg/abi/dcast1.C: Likewise.
        * g++.dg/abi/covariant2.C: Likewise.
        * g++.dg/inherit/covariant11.C: Likewise.
        * g++.dg/inherit/covariant9.C: Likewise.
        * g++.dg/inherit/covariant10.C: Likewise.
        * g++.dg/init/static3.C: Likewise.
        * g++.dg/init/init-ref3.C: Likewise.
        * g++.dg/init/ref10.C: Likewise.
        * g++.dg/template/meminit2.C: Likewise.
        * g++.dg/template/using9.C: Likewise.
        * g++.dg/template/friend9.C: Likewise.
        * g++.dg/template/ref1.C: Likewise.
        * g++.old-deja/g++.warn/inline.C: Likewise.
        * g++.old-deja/g++.robertl/eb91.C: Likewise.
        * g++.old-deja/g++.robertl/eb46.C: Likewise.
        * g++.old-deja/g++.robertl/eb34.C: Likewise.
        * g++.old-deja/g++.robertl/eb43.C: Likewise.
        * g++.old-deja/g++.robertl/eb26.C: Likewise.
        * g++.old-deja/g++.robertl/eb116.C: Likewise.
        * g++.old-deja/g++.brendan/copy5.C: Likewise.
        * g++.old-deja/g++.brendan/overload8.C: Likewise.
        * g++.old-deja/g++.brendan/overload11.C: Likewise.
        * g++.old-deja/g++.brendan/copy7.C: Likewise.
        * g++.old-deja/g++.brendan/crash38.C: Likewise.
        * g++.old-deja/g++.brendan/template11.C: Likewise.
        * g++.old-deja/g++.brendan/err-msg3.C: Likewise.
        * g++.old-deja/g++.brendan/crash50.C: Likewise.
        * g++.old-deja/g++.brendan/crash16.C: Likewise.
        * g++.old-deja/g++.jason/pmem2.C: Likewise.
        * g++.old-deja/g++.jason/parse9.C: Likewise.
        * g++.old-deja/g++.jason/byval2.C: Likewise.
        * g++.old-deja/g++.jason/overload8.C: Likewise.
        * g++.old-deja/g++.jason/pmf8.C: Likewise.
        * g++.old-deja/g++.jason/template33.C: Likewise.
        * g++.old-deja/g++.jason/return3.C: Likewise.
        * g++.old-deja/g++.jason/scoping2.C: Likewise.
        * g++.old-deja/g++.jason/virtual.C: Likewise.
        * g++.old-deja/g++.jason/opeq3.C: Likewise.
        * g++.old-deja/g++.jason/template27.C: Likewise.
        * g++.old-deja/g++.jason/synth6.C: Likewise.
        * g++.old-deja/g++.jason/ref8.C: Likewise.
        * g++.old-deja/g++.jason/offset1.C: Likewise.
        * g++.old-deja/g++.other/static20.C: Likewise.
        * g++.old-deja/g++.other/array1.C: Likewise.
        * g++.old-deja/g++.other/new3.C: Likewise.
        * g++.old-deja/g++.other/array2.C: Likewise.
        * g++.old-deja/g++.other/overload9.C: Likewise.
        * g++.old-deja/g++.other/cast6.C: Likewise.
        * g++.old-deja/g++.other/ptrmem8.C: Likewise.
        * g++.old-deja/g++.other/eh4.C: Likewise.
        * g++.old-deja/g++.other/using7.C: Likewise.
        * g++.old-deja/g++.other/init18.C: Likewise.
        * g++.old-deja/g++.other/dyncast1.C: Likewise.
        * g++.old-deja/g++.other/dyncast2.C: Likewise.
        * g++.old-deja/g++.other/dtor11.C: Likewise.
        * g++.old-deja/g++.pt/static11.C: Likewise.
        * g++.old-deja/g++.pt/crash19.C: Likewise.
        * g++.old-deja/g++.pt/overload12.C: Likewise.
        * g++.old-deja/g++.pt/crash46.C: Likewise.
        * g++.old-deja/g++.pt/mi1.C: Likewise.
        * g++.old-deja/g++.pt/vaarg3.C: Likewise.
        * g++.old-deja/g++.pt/nontype5.C: Likewise.
        * g++.old-deja/g++.pt/local5.C: Likewise.
        * g++.old-deja/g++.pt/typename2.C: Likewise.
        * g++.old-deja/g++.pt/explicit80.C: Likewise.
        * g++.old-deja/g++.pt/auto_ptr.C: Likewise.
        * g++.old-deja/g++.law/visibility1.C: Likewise.
        * g++.old-deja/g++.law/visibility2.C: Likewise.
        * g++.old-deja/g++.law/virtual2.C: Likewise.
        * g++.old-deja/g++.law/operators19.C: Likewise.
        * g++.old-deja/g++.law/parsing10.C: Likewise.
        * g++.old-deja/g++.law/visibility4.C: Likewise.
        * g++.old-deja/g++.law/operators4.C: Likewise.
        * g++.old-deja/g++.law/dtors2.C: Likewise.
        * g++.old-deja/g++.law/missed-error3.C: Likewise.
        * g++.old-deja/g++.law/visibility10.C: Likewise.
        * g++.old-deja/g++.law/scope3.C: Likewise.
        * g++.old-deja/g++.law/casts2.C: Likewise.
        * g++.old-deja/g++.law/code-gen5.C: Likewise.
        * g++.old-deja/g++.law/operators33.C: Likewise.
        * g++.old-deja/g++.law/friend4.C: Likewise.
        * g++.old-deja/g++.mike/pmf7.C: Likewise.
        * g++.old-deja/g++.mike/p5611.C: Likewise.
        * g++.old-deja/g++.mike/net37.C: Likewise.
        * g++.old-deja/g++.mike/p3570.C: Likewise.
        * g++.old-deja/g++.mike/p5718.C: Likewise.
        * g++.old-deja/g++.mike/net21.C: Likewise.
        * g++.old-deja/g++.mike/p1862.C: Likewise.
        * g++.old-deja/g++.mike/p4511.C: Likewise.
        * g++.old-deja/g++.mike/virt3.C: Likewise.
        * g++.old-deja/g++.mike/p16146.C: Likewise.
        * g++.old-deja/g++.mike/p1989.C: Likewise.
        * g++.old-deja/g++.mike/p5571.C: Likewise.
        * g++.old-deja/g++.gb/scope10.C: Likewise.
        * g++.old-deja/g++.abi/primary5.C: Likewise.
        * g++.old-deja/g++.abi/empty2.C: Likewise.
        * g++.old-deja/g++.abi/arraynew.C: Likewise.
        * g++.old-deja/g++.eh/vbase4.C: Likewise.
        * g++.old-deja/g++.eh/ptr1.C: Likewise.
        * g++.old-deja/g++.eh/cleanup1.C: Likewise.
        * g++.old-deja/g++.bob/template3.C: Likewise.
        * g++.old-deja/g++.bob/inherit1.C: Likewise.

From-SVN: r123132
parent 1efd1a2f
2007-03-22 Dirk Mueller <dmueller@suse.de>
* g++.old-deja/g++.brendan/warnings2.C: Don't use -pedantic.
* g++.dg/other/static1.C: Remove stray semicolon.
* g++.dg/other/init1.C: Likewise.
* g++.dg/rtti/dyncast1.C: Likewise.
* g++.dg/tree-ssa/pr17153.C: Likewise.
* g++.dg/lookup/disamb1.C: Likewise.
* g++.dg/lookup/scoped2.C: Likewise.
* g++.dg/lookup/friend7.C: Likewise.
* g++.dg/parse/parse4.C: Likewise.
* g++.dg/parse/parse5.C: Likewise.
* g++.dg/expr/pr29066.C: Likewise.
* g++.dg/expr/cast4.C: Likewise.
* g++.dg/tc1/dr193.C: Likewise.
* g++.dg/tc1/dr213.C: Likewise.
* g++.dg/abi/dcast1.C: Likewise.
* g++.dg/abi/covariant2.C: Likewise.
* g++.dg/inherit/covariant11.C: Likewise.
* g++.dg/inherit/covariant9.C: Likewise.
* g++.dg/inherit/covariant10.C: Likewise.
* g++.dg/init/static3.C: Likewise.
* g++.dg/init/init-ref3.C: Likewise.
* g++.dg/init/ref10.C: Likewise.
* g++.dg/template/meminit2.C: Likewise.
* g++.dg/template/using9.C: Likewise.
* g++.dg/template/friend9.C: Likewise.
* g++.dg/template/ref1.C: Likewise.
* g++.old-deja/g++.warn/inline.C: Likewise.
* g++.old-deja/g++.robertl/eb91.C: Likewise.
* g++.old-deja/g++.robertl/eb46.C: Likewise.
* g++.old-deja/g++.robertl/eb34.C: Likewise.
* g++.old-deja/g++.robertl/eb43.C: Likewise.
* g++.old-deja/g++.robertl/eb26.C: Likewise.
* g++.old-deja/g++.robertl/eb116.C: Likewise.
* g++.old-deja/g++.brendan/copy5.C: Likewise.
* g++.old-deja/g++.brendan/overload8.C: Likewise.
* g++.old-deja/g++.brendan/overload11.C: Likewise.
* g++.old-deja/g++.brendan/copy7.C: Likewise.
* g++.old-deja/g++.brendan/crash38.C: Likewise.
* g++.old-deja/g++.brendan/template11.C: Likewise.
* g++.old-deja/g++.brendan/err-msg3.C: Likewise.
* g++.old-deja/g++.brendan/crash50.C: Likewise.
* g++.old-deja/g++.brendan/crash16.C: Likewise.
* g++.old-deja/g++.jason/pmem2.C: Likewise.
* g++.old-deja/g++.jason/parse9.C: Likewise.
* g++.old-deja/g++.jason/byval2.C: Likewise.
* g++.old-deja/g++.jason/overload8.C: Likewise.
* g++.old-deja/g++.jason/pmf8.C: Likewise.
* g++.old-deja/g++.jason/template33.C: Likewise.
* g++.old-deja/g++.jason/return3.C: Likewise.
* g++.old-deja/g++.jason/scoping2.C: Likewise.
* g++.old-deja/g++.jason/virtual.C: Likewise.
* g++.old-deja/g++.jason/opeq3.C: Likewise.
* g++.old-deja/g++.jason/template27.C: Likewise.
* g++.old-deja/g++.jason/synth6.C: Likewise.
* g++.old-deja/g++.jason/ref8.C: Likewise.
* g++.old-deja/g++.jason/offset1.C: Likewise.
* g++.old-deja/g++.other/static20.C: Likewise.
* g++.old-deja/g++.other/array1.C: Likewise.
* g++.old-deja/g++.other/new3.C: Likewise.
* g++.old-deja/g++.other/array2.C: Likewise.
* g++.old-deja/g++.other/overload9.C: Likewise.
* g++.old-deja/g++.other/cast6.C: Likewise.
* g++.old-deja/g++.other/ptrmem8.C: Likewise.
* g++.old-deja/g++.other/eh4.C: Likewise.
* g++.old-deja/g++.other/using7.C: Likewise.
* g++.old-deja/g++.other/init18.C: Likewise.
* g++.old-deja/g++.other/dyncast1.C: Likewise.
* g++.old-deja/g++.other/dyncast2.C: Likewise.
* g++.old-deja/g++.other/dtor11.C: Likewise.
* g++.old-deja/g++.pt/static11.C: Likewise.
* g++.old-deja/g++.pt/crash19.C: Likewise.
* g++.old-deja/g++.pt/overload12.C: Likewise.
* g++.old-deja/g++.pt/crash46.C: Likewise.
* g++.old-deja/g++.pt/mi1.C: Likewise.
* g++.old-deja/g++.pt/vaarg3.C: Likewise.
* g++.old-deja/g++.pt/nontype5.C: Likewise.
* g++.old-deja/g++.pt/local5.C: Likewise.
* g++.old-deja/g++.pt/typename2.C: Likewise.
* g++.old-deja/g++.pt/explicit80.C: Likewise.
* g++.old-deja/g++.pt/auto_ptr.C: Likewise.
* g++.old-deja/g++.law/visibility1.C: Likewise.
* g++.old-deja/g++.law/visibility2.C: Likewise.
* g++.old-deja/g++.law/virtual2.C: Likewise.
* g++.old-deja/g++.law/operators19.C: Likewise.
* g++.old-deja/g++.law/parsing10.C: Likewise.
* g++.old-deja/g++.law/visibility4.C: Likewise.
* g++.old-deja/g++.law/operators4.C: Likewise.
* g++.old-deja/g++.law/dtors2.C: Likewise.
* g++.old-deja/g++.law/missed-error3.C: Likewise.
* g++.old-deja/g++.law/visibility10.C: Likewise.
* g++.old-deja/g++.law/scope3.C: Likewise.
* g++.old-deja/g++.law/casts2.C: Likewise.
* g++.old-deja/g++.law/code-gen5.C: Likewise.
* g++.old-deja/g++.law/operators33.C: Likewise.
* g++.old-deja/g++.law/friend4.C: Likewise.
* g++.old-deja/g++.mike/pmf7.C: Likewise.
* g++.old-deja/g++.mike/p5611.C: Likewise.
* g++.old-deja/g++.mike/net37.C: Likewise.
* g++.old-deja/g++.mike/p3570.C: Likewise.
* g++.old-deja/g++.mike/p5718.C: Likewise.
* g++.old-deja/g++.mike/net21.C: Likewise.
* g++.old-deja/g++.mike/p1862.C: Likewise.
* g++.old-deja/g++.mike/p4511.C: Likewise.
* g++.old-deja/g++.mike/virt3.C: Likewise.
* g++.old-deja/g++.mike/p16146.C: Likewise.
* g++.old-deja/g++.mike/p1989.C: Likewise.
* g++.old-deja/g++.mike/p5571.C: Likewise.
* g++.old-deja/g++.gb/scope10.C: Likewise.
* g++.old-deja/g++.abi/primary5.C: Likewise.
* g++.old-deja/g++.abi/empty2.C: Likewise.
* g++.old-deja/g++.abi/arraynew.C: Likewise.
* g++.old-deja/g++.eh/vbase4.C: Likewise.
* g++.old-deja/g++.eh/ptr1.C: Likewise.
* g++.old-deja/g++.eh/cleanup1.C: Likewise.
* g++.old-deja/g++.bob/template3.C: Likewise.
* g++.old-deja/g++.bob/inherit1.C: Likewise.
2006-03-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31193
......@@ -10,7 +10,7 @@ struct c1 {};
struct c3 : virtual c1
{
virtual c1* f6() {};
virtual c1* f6() {}
int i;
};
......@@ -18,7 +18,7 @@ struct c6 : virtual c3 { };
struct c7 : c3
{
virtual c3* f6() {};
virtual c3* f6() {}
};
struct c24 : virtual c7
......
......@@ -5,20 +5,20 @@
// PR 9433. segfault at runtime.
struct A { virtual void f() {}; };
struct A { virtual void f() {} };
struct B {int b;};
struct C : A, B { virtual void f() {}; int c;};
struct C : A, B { virtual void f() {} int c;};
struct D : C {int d;};
struct E : C {int e;};
struct F : protected D, E {int f;};
struct H : virtual F {int h;};
struct I : H {int i;};
struct J : H {int j;};
struct K : I, J { virtual void f() {}; int k; };
struct K : I, J { virtual void f() {} int k; };
struct M : K {int m;};
struct N : M {int n;};
struct O : M {int o;};
struct P : N, O { virtual void f() {}; int p;};
struct P : N, O { virtual void f() {} int p;};
int main()
{
......
......@@ -10,8 +10,8 @@ struct foo {
class Foobar : public foo {
public:
Foobar() { a = 1; b = 2; };
virtual ~Foobar() {};
Foobar() { a = 1; b = 2; }
virtual ~Foobar() {}
};
Foobar obj;
......
......@@ -11,7 +11,7 @@ struct X
struct Z : public X
{
void a(void) {};
void a(void) {}
};
......
......@@ -5,18 +5,18 @@
// PR c++/12699 ICE with covariancy
struct c1 {
virtual void f1() const {};
virtual void f1() const {}
};
struct c5 {};
struct c6 : virtual c1 {
virtual c5* f33() const {};
virtual c5* f33() const {}
};
struct c13 : virtual c5 { };
struct c17 : virtual c6
{
virtual c13* f33() const {};
virtual c13* f33() const {}
};
......@@ -7,19 +7,19 @@
struct c2 { int i; };
struct c1 {
virtual c2& f8() {};
virtual c2& f8() {}
};
struct c3 : c1, c2 {
virtual c2& f8() {};
virtual c2& f8() {}
};
struct c11 : public c1 {
virtual c3& f8() {};
virtual c3& f8() {}
};
struct c15 : virtual c3 {
virtual c2& f8() {};
virtual c2& f8() {}
};
struct c18 : virtual c11 {
......
......@@ -9,19 +9,19 @@ struct c1 {};
struct c0 {
int i;
virtual c1& f10() {};
virtual c1& f10() {}
};
struct c2 : virtual c1, c0 { };
struct c6 : virtual c2, c0 {
virtual c2& f10() {};
virtual c2& f10() {}
};
struct c14 : virtual c2 { };
struct c19 : virtual ::c6 {
virtual class ::c14& f10() {};
virtual class ::c14& f10() {}
};
int main ()
......
......@@ -9,8 +9,8 @@ protected:
public:
Ptr(void) : ptr(0) { };
Ptr(T * p) : ptr(p) { };
Ptr(void) : ptr(0) { }
Ptr(T * p) : ptr(p) { }
~Ptr(void) { delete ptr; }
......
......@@ -2,10 +2,10 @@
struct A {};
struct B : protected A {
B() {};
B(const A& ) {};
B() {}
B(const A& ) {}
private:
B(const B& ) {};
B(const B& ) {}
};
void foo(const A* ap)
......
......@@ -3,7 +3,7 @@
struct T
{
static void (*handler)();
static void func() {};
static void func() {}
};
bool fail;
......
......@@ -11,5 +11,5 @@ struct B2: public A {};
struct C: public B1, public B2
{
void g() { B1::f(); };
void g() { B1::f(); }
};
// { dg-do compile }
// PR c++/7874: Don't inject friend functions into global name space.
namespace N { template<typename T> struct A { friend void f(A) { }; }; }
namespace N { template<typename T> struct A { friend void f(A) { } }; }
int main()
{
N::A<int> a;
......
......@@ -15,5 +15,5 @@ struct Derived : Base
{
Base::Baz (); // { dg-error "is not a member" "" }
};
}
};
......@@ -11,7 +11,7 @@ struct B : A
{
typedef A Parent;
B () : Parent () {};
B () : Parent () {}
};
class T
......
......@@ -13,5 +13,5 @@ struct foo {
};
struct bar {
int z;
bar () { foo::x[z]; };
bar () { foo::x[z]; }
};
......@@ -20,6 +20,6 @@ class Camera2
{
public:
Camera2(const Hvec &basepos);
inline Camera2() { Camera2(Hvec(0.0,0.0,0.0)); };
inline Camera2() { Camera2(Hvec(0.0,0.0,0.0)); }
~Camera2();
};
......@@ -11,8 +11,8 @@ class BadStream : public ostringstream
{
public:
enum InternalEnum { VALUE = 0 };
BadStream( InternalEnum e ) {};
BadStream( InternalEnum e, int i ) {};
BadStream( InternalEnum e ) {}
BadStream( InternalEnum e, int i ) {}
};
int main()
......
......@@ -3,7 +3,7 @@ class JunkBase
public:
virtual void DoSomething( void ) = 0;
protected:
virtual ~JunkBase( void ) {};
virtual ~JunkBase( void ) {}
JunkBase( void ) {}
};
......
......@@ -27,7 +27,7 @@ namespace N1 {
B x;
~C() {
A y;
};
}
};
}
......@@ -59,7 +59,7 @@ namespace N2 {
B<T> x;
~C() {
A<T> y;
};
}
};
}
......
......@@ -14,7 +14,7 @@ template <class T> struct A : T {
struct B {
void f(B);
void g(B) {};
void g(B) {}
};
void f(B) {}
......
......@@ -14,5 +14,5 @@ template <typename P> class Y {
};
template <typename T> struct X<1,T> {
X () { Y<T>::i; }; // access private field
X () { Y<T>::i; } // access private field
};
......@@ -9,13 +9,13 @@ template <typename K1> struct O {
template <typename T>
struct A : typename O<T>::template I<int> { // { dg-error "keyword 'typename' not allowed" }
A() : typename O<T>::template I<int>() // { dg-error "keyword 'typename' not allowed" }
{};
{}
};
template <typename T>
struct B : O<T>::template I<int> {
B() : O<T>::I<int>() // { dg-error "used as template|it is a template" "" }
{};
{}
};
// { dg-bogus "end of input" "bogus token skipping in the parser" { xfail *-*-* } 17 }
class a {} a1;
template <a & p> class b { public: b() { static_cast <a &> (p); }; };
template <a & p> class b { public: b() { static_cast <a &> (p); } };
int main() { b <a1> b1; }
......@@ -4,9 +4,9 @@
// PR c++/17154: Using declaration in partial class template specialization.
template <int numrows, class T> struct A { void test_A() {}; };
template <int numrows, class T> struct A { void test_A() {} };
template <int numrows, class T> struct B {};
template <class T> struct B <3, T> : public A <3, T> {
using A <3, T>::test_A;
void test_B_spec() { test_A(); };
void test_B_spec() { test_A(); }
};
......@@ -11,7 +11,7 @@ struct B : A
{
foo(__PRETTY_FUNCTION__);
return B();
};
}
};
B b=B().bar();
......@@ -94,19 +94,19 @@ void check_placement_cookie (int i)
struct X {};
template <typename T>
struct Y { int i; virtual void f () {}; };
struct Y { int i; virtual void f () {} };
// A class with a non-trivial destructor -- it needs a cookie.
struct Z { ~Z () {}; };
struct Z { ~Z () {} };
// Likewise, but this class needs a bigger cookie so that the array
// elements are correctly aligned.
struct Z2 { ~Z2 () {}; long double d; };
struct Z2 { ~Z2 () {} long double d; };
struct W1 { void operator delete[] (void *, size_t) {}; };
struct W2 { void operator delete[] (void *) {};
void operator delete[] (void *, size_t) {}; };
struct W3 { void operator delete[] (void *, size_t) {};
void operator delete[] (void *) {}; };
struct W1 { void operator delete[] (void *, size_t) {} };
struct W2 { void operator delete[] (void *) {}
void operator delete[] (void *, size_t) {} };
struct W3 { void operator delete[] (void *, size_t) {}
void operator delete[] (void *) {} };
struct W4 : public W1 {};
struct V { void *operator new[] (size_t s, void *p)
......
......@@ -17,35 +17,35 @@ struct B8 : A {};
struct C1 : B1
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C2 : B1, B2
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C3 : B1, B2, B3
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C4 : B1, B2, B3, B4
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C5 : B1, B2, B3, B4, B5
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C6 : B1, B2, B3, B4, B5, B6
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C7 : B1, B2, B3, B4, B5, B6, B7
{
virtual void Foo () {};
virtual void Foo () {}
};
struct C8 : B1, B2, B3, B4, B5, B6, B7, B8
{
virtual void Foo () {};
virtual void Foo () {}
};
struct D1 : virtual C1 {};
......
......@@ -6,7 +6,7 @@
struct A1
{
virtual void Foo () {};
virtual void Foo () {}
};
struct A : A1
......
......@@ -2,7 +2,7 @@
class A {
char str[10];
public:
char* m1 () { return str;};
char* m1 () { return str;}
};
class C : public A {
......
......@@ -38,7 +38,7 @@ public:
class ObjectExchange
{
public:
ObjectExchange() {};
ObjectExchange() {}
ExchangeableList i_theWatchList; // Instruments being monitored
};
......
......@@ -35,10 +35,10 @@ class BaseClass {
public:
BaseClass( const BaseClass& ir ) : i(ir.i) {};
BaseClass() : i(5) {};
BaseClass( const BaseClass& ir ) : i(ir.i) {}
BaseClass() : i(5) {}
virtual int virtMember() { return( 999 ); };
virtual int virtMember() { return( 999 ); }
void Increm( int r );
};
......@@ -54,7 +54,7 @@ void BaseClass::Increm( int r )
class DerivedClass : public BaseClass {
public:
int virtMember() { return( 30 ); };
int virtMember() { return( 30 ); }
};
int operator != (const BaseClass irv, int x) { return irv.i != x; }
......
......@@ -8,7 +8,7 @@ void die () { printf ("FAIL\n"); exit (1); }
class B {
public:
B() {}
B(const B &) { printf ("PASS\n"); exit (0); };
B(const B &) { printf ("PASS\n"); exit (0); }
private:
int x;
};
......
......@@ -3,7 +3,7 @@
class Graph {
public:
unsigned char N;
Graph(void) {}; // { dg-error "previously defined here" }
Graph(void) {} // { dg-error "previously defined here" }
}
Graph::Graph(void) // { dg-error "return type|redefinition|semicolon" }
......
......@@ -24,8 +24,8 @@ public:
template< class T, int n> class Implicit : public T {
public:
typedef typename T::BASE BASE;
Implicit(BASE value ): T(value) {};
Implicit() : T() {};
Implicit(BASE value ): T(value) {}
Implicit() : T() {}
int myTag() { return n; }
void encode() { T::encode(); }
BASE operator=(BASE t) { return T::operator=(t); }
......
......@@ -17,7 +17,7 @@ public:
C &operator = (const C &x)
{
return *this;
};
}
};
C &(C::*DD)(const C &x) = &C::operator=;
......
......@@ -10,7 +10,7 @@
class test{
public:
int flags;
test() {};
test() {}
};
int main()
......
......@@ -5,7 +5,7 @@ class foo_int
public:
int & i;
foo_int (int &j) : i(j) {};
foo_int (int &j) : i(j) {}
void inc () { i++; }
};
......@@ -2,7 +2,7 @@
// GROUPS passed overloading
typedef struct{double re,im;} complex;
class Complex{public:double re,im;
inline void operator=(Complex&X){re=X.re; im=X.im;};};
inline void operator=(Complex&X){re=X.re; im=X.im;}};
void zxcvbnm(int n,...){n=1;}
int main(){complex c; Complex C;
zxcvbnm(1,c);
......
......@@ -34,7 +34,7 @@ int aCallback<Called>::callback()
struct myStruct
{
int action() {return 24;};
int action() {return 24;}
};
int main()
......
// { dg-do assemble }
// { dg-do compile }
// { dg-options "-Wall -Wextra" }
// GROUPS passed warnings
class K {
public:
......
......@@ -13,7 +13,7 @@ struct myExcRaiser {
};
struct stackObj {
~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); };
~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); }
};
int test()
......
......@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...);
struct E {
int x;
E(int i) { x = i; };
E(int i) { x = i; }
};
int main()
......
......@@ -13,8 +13,8 @@ static int ok = 0;
struct A
{
A (){};
virtual ~A () {};
A (){}
virtual ~A () {}
};
struct B : virtual A
......
......@@ -4,6 +4,6 @@ void Foo (void)
{
class C {
public:
virtual int foo (void) { return 0; };
virtual int foo (void) { return 0; }
};
}
......@@ -8,7 +8,7 @@ class Char
protected:
char rep;
public:
Char (const char ) {};
Char (const char ) {}
operator char() const;
void operator -= (const Char );
};
......
......@@ -2,7 +2,7 @@
// PRMS Id: 5070 (testcase 1)
struct foo {
foo(int x = 0) {};
foo(int x = 0) {}
int IsAlive(void) { return 1; }
};
......
......@@ -4,7 +4,7 @@
class X { // { dg-error "assignment" }
int& a;
public:
X(int& i): a(i) { };
X(int& i): a(i) { }
};
void foo ()
......
......@@ -2,6 +2,6 @@
// Bug: g++ fails to catch the ambiguity below.
struct A {
operator int () { return 1; };
operator int &() { return 1; }; // { dg-error "" }
operator int () { return 1; }
operator int &() { return 1; } // { dg-error "" }
};
......@@ -6,7 +6,7 @@ class Fu
{
int val;
public:
Fu(int i) : val(i) { };
Fu(int i) : val(i) { }
void print() { }
};
......
......@@ -31,7 +31,7 @@ int aCallback<Called>::callback()
struct myStruct
{
int action() {return 0;};
int action() {return 0;}
};
int main()
......
......@@ -3,7 +3,7 @@
class Parent {
public:
void DoSomething() { return; };
void DoSomething() { return; }
int i;
};
......
......@@ -4,7 +4,7 @@
struct A {};
struct B {
virtual void foo () {};
virtual void foo () {}
};
struct C : public B, public A {};
......
......@@ -2,7 +2,7 @@
// PRMS id: 10912
struct A {
A() { i=10; };
A() { i=10; }
int i;
};
struct B : public A {};
......
......@@ -7,8 +7,8 @@ struct A
struct B
{
int f;
B() : f(0) {};
void g() { f = 0; };
B() : f(0) {}
void g() { f = 0; }
};
void f();
void f(int);
......
......@@ -11,5 +11,5 @@ private:
class DbmItem: public RefCount{
public:
DbmItem(): RefCount() {};
DbmItem(): RefCount() {}
};
......@@ -29,13 +29,13 @@ void Test<T>::doThat()
class A
{
public:
void thiss() {};
void thiss() {}
};
class B
{
public:
void that() {};
void that() {}
};
int main()
......
......@@ -7,7 +7,7 @@ class A
public:
enum muni {X, Y};
muni e() { return X; };
muni e() { return X; }
muni f();
};
......
......@@ -24,15 +24,15 @@ public:
class C: public A, public B
{
public:
virtual void a2() {};
virtual void b2() {};
virtual void a2() {}
virtual void b2() {}
};
class D : public C
{
public:
virtual void a1() {};
virtual void b1() {};
virtual void a1() {}
virtual void b1() {}
};
int main()
......
......@@ -16,7 +16,7 @@ class VObject {
boolean perform(method );
boolean perform(method , long);
void affectMethod(method );
void dummy(){};
void dummy(){}
};
......
......@@ -70,7 +70,7 @@ class Vector
Vector( int, double *, int beg = 0 );
Vector( const Vector & );
Vector &operator=( const Vector & );
~Vector() { if(r) r->unrefer(); };
~Vector() { if(r) r->unrefer(); }
int row() const { return 19; }
int dim() const { return 10; }
......
......@@ -8,19 +8,19 @@ class bla {
public:
inline bla(const char * jim) { ; };
inline bla(const char * jim) { ; }
inline ~bla() { destruct++; if (destruct == 2) printf ("PASS\n");};
inline ~bla() { destruct++; if (destruct == 2) printf ("PASS\n");}
};
class ulk {
public:
inline ulk() {};
inline ~ulk() {};
inline ulk() {}
inline ~ulk() {}
void funk(const bla & bob) { ;};
void funk(const bla & bob) { ;}
// ^ interestingly, the code compiles right if
// this & is deleted (and therefore the parameter
// passed as value)
......
......@@ -15,5 +15,5 @@ class T {
class T2 {
friend void f (int& i) { // BOGUS -
i = 1;
};
}
};
......@@ -15,7 +15,7 @@ class Traversable {
public:
virtual const T item() const = 0;
virtual const bool off() const = 0;
virtual ~Traversable() { };
virtual ~Traversable() { }
};
class Chain : public Traversable {
......@@ -47,7 +47,7 @@ protected:
virtual void go_offright() const = 0;
virtual void copy(const List& other) = 0;
public:
List() : item_count(0), cursor_position(0) { };
List() : item_count(0), cursor_position(0) { }
virtual const int count() const;
virtual const bool empty() const;
virtual const bool isfirst() const;
......@@ -105,7 +105,7 @@ protected:
virtual void copy(const List& other);
public:
Fixed_List(const List& other);
Fixed_List(const int size): Array(1, size) { };
Fixed_List(const int size): Array(1, size) { }
virtual const bool empty() const;
virtual const int count() const;
virtual const T item() const;
......@@ -113,7 +113,7 @@ public:
virtual void move(const int index) const;
virtual void put(const T value);
virtual void put_i_th(const T value, const int index);
virtual void wipe_out() { };
virtual void wipe_out() { }
Fixed_List& operator=(const List& other);
};
......
......@@ -15,5 +15,5 @@ class B: public A {
public:
B () {
!(A::j);
};
}
};
......@@ -18,7 +18,7 @@ struct fcell {
class FStack {
public:
struct fcell *top;
FStack() { top = NULL ; } ;
FStack() { top = NULL ; }
inline void push(FILE * fd1, int line_num, char *fname = NULL) {
struct fcell *tmp = new struct fcell;
tmp->fd = fd1;
......
......@@ -14,7 +14,7 @@ class Vector {
int size;
Complex *v;
public:
Vector(int s=1) { size = s; v = new Complex[size];};
Vector(int s=1) { size = s; v = new Complex[size];}
~Vector() { delete [size] v;}// { dg-error "" } warning
};
......
......@@ -19,7 +19,7 @@ public:
class l
{
public:
void s() {};
void s() {}
};
extern t<l> g;
......@@ -28,5 +28,5 @@ class p
{
public:
void *h;
s *a() {return (s *) h;};
s *a() {return (s *) h;}
};
......@@ -11,12 +11,12 @@ void f()
{
{
struct A {
A() {};
A() {}
} a;
};
{
struct A {
A() {};
A() {}
} a ;
};
}
......@@ -12,7 +12,7 @@ class doubleclass
{
public:
double d;
doubleclass(double x = 0) { d = x; };
doubleclass(double x = 0) { d = x; }
};
class test
......
......@@ -8,17 +8,17 @@ class base {
//==========
void base_priv(const char * n)
{ std::cout << "base_priv called from: " << n << "\n"; };
{ std::cout << "base_priv called from: " << n << "\n"; }
protected:
void base_prot(const char * n)
{ std::cout << "base_prot called from: " << n << "\n"; };
{ std::cout << "base_prot called from: " << n << "\n"; }
public:
void base_publ(const char * n)
{ std::cout << "base_publ called from: " << n << "\n"; };
{ std::cout << "base_publ called from: " << n << "\n"; }
void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); }
......
......@@ -5,8 +5,8 @@
class base {
public:
void f1 () { std::cout << "f1" << std::endl; };
void f2 () { std::cout << "f2" << std::endl; };
void f1 () { std::cout << "f1" << std::endl; }
void f2 () { std::cout << "f2" << std::endl; }
};
class deriv : public base {
......
......@@ -8,17 +8,17 @@ class base {
//==========
void base_priv(const char * n)
{ std::cout << "base_priv called from: " << n << "\n"; };
{ std::cout << "base_priv called from: " << n << "\n"; }
protected:
void base_prot(const char * n)
{ std::cout << "base_prot called from: " << n << "\n"; };
{ std::cout << "base_prot called from: " << n << "\n"; }
public:
void base_publ(const char * n)
{ std::cout << "base_publ called from: " << n << "\n"; };
{ std::cout << "base_publ called from: " << n << "\n"; }
void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); }
......
......@@ -21,5 +21,5 @@ extern "C" int printf( const char *, ...);
class E : public C {
void f() {
printf( "%d\n", b);// { dg-error "" } .*
};
}
};
......@@ -10,7 +10,7 @@ struct a
struct b
{
virtual void g() { };
virtual void g() { }
};
struct c: public a, public b
......
......@@ -17,7 +17,7 @@ typedef void (D::*DPROC)(void);
union AFX_PMSG {
public:
AFX_PMSG () {};
AFX_PMSG () {}
AFX_PMSG ( BPROC bpr ) { bfn = bpr ; }
operator BPROC() { return bfn; }
......
......@@ -5,8 +5,8 @@ extern "C" int printf (const char *, ...);
class myFoundation {
protected:
myFoundation () { count = 0; };
virtual ~myFoundation () {};
myFoundation () { count = 0; }
virtual ~myFoundation () {}
public:
void addRef () { ++count; }
......@@ -19,8 +19,8 @@ private:
class firstIntermediate :virtual public myFoundation {
public:
firstIntermediate () {};
~firstIntermediate () {};
firstIntermediate () {}
~firstIntermediate () {}
void bar () { printf ("Bar\n"); }
};
......@@ -28,58 +28,58 @@ public:
class firstBase : public firstIntermediate {
public:
firstBase () {};
~firstBase () {};
firstBase () {}
~firstBase () {}
virtual void g () {};
virtual void g () {}
};
class secondIntermediate : virtual public myFoundation {
public:
secondIntermediate () {};
~secondIntermediate () {};
secondIntermediate () {}
~secondIntermediate () {}
virtual void h () {};
virtual void h () {}
};
class secondBase : public secondIntermediate {
public:
secondBase () {};
~secondBase () {};
secondBase () {}
~secondBase () {}
virtual void h () {};
virtual void h () {}
};
class typeInterface : virtual public firstBase {
public:
typeInterface () {};
~typeInterface () {};
typeInterface () {}
~typeInterface () {}
virtual void i () {};
virtual void i () {}
};
class classServices : virtual public firstBase,
public secondBase {
public:
classServices () {};
~classServices () {};
classServices () {}
~classServices () {}
virtual void j () {};
virtual void j () {}
};
class classImplementation : public typeInterface,
public classServices {
public:
classImplementation () {};
~classImplementation () {};
classImplementation () {}
~classImplementation () {}
void g () {};
void h () {};
void i () {};
void j () {};
void g () {}
void h () {}
void i () {}
void j () {}
};
int main () {
......
......@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...);
class A
{
public:
virtual ~A(){};
virtual ~A(){}
virtual int type(void)
{
return -1;
......@@ -15,7 +15,7 @@ public:
class B
{
public:
virtual ~B(){};
virtual ~B(){}
};
......
......@@ -12,9 +12,9 @@ struct link {
link *prev;
link(const T& t): item(t), prev(0), next(0)
{ };
{ }
link(const T& t, link<T> *p, link<T> *n): item(t), prev(p), next(n)
{ };
{ }
};
template<class T>
......@@ -182,9 +182,9 @@ template<class T>
class List_DLS: public List_DL<T> {
public:
List_DLS(): List_DL<T>()
{ };
{ }
List_DLS(const List_DLS& other): List_DL<T>(other)
{ };
{ }
bool contains(const T& item) const
{ return search(item) != 0 ? TRUE: FALSE; }
......@@ -206,9 +206,9 @@ template<class T>
class List_DLSp: public List_DL<T> {
public:
List_DLSp(): List_DL<T>()
{ };
{ }
List_DLSp(const List_DLSp& other): List_DL<T>(other)
{ };
{ }
bool contains(const T& item) const
#ifndef INTERNAL_ERROR
......@@ -335,9 +335,9 @@ struct vertex {
List_DL<vertex<T> *> fanout;
vertex(): item(), fanout() // { dg-bogus "" }
{ };
{ }
vertex(const T& i): item(), fanout() // { dg-bogus "" }
{ };
{ }
};
template<class T>
......
......@@ -4,17 +4,17 @@
extern "C" int printf(const char *, ...);
struct A {
void print() {printf("A");};
void print() {printf("A");}
};
struct B : A {
typedef A superB;
void print() {superB::print(); printf("B");};
void print() {superB::print(); printf("B");}
};
struct C : B {
typedef B superC;
void print() {superC::print(); printf("C");};
void print() {superC::print(); printf("C");}
};
int main ()
......
......@@ -5,7 +5,7 @@ int bad;
class A {
public:
virtual void dummy (){};
virtual void dummy (){}
};
class B {
......@@ -15,12 +15,12 @@ public:
class C : public A, public B {
public:
void f(void) { bad=1; };
void f(void) { bad=1; }
};
class D : public C {
public:
void f(void) { };
void f(void) { }
};
class E : public D { };
......
......@@ -6,9 +6,9 @@ void *vp = 0;
class ParentOne {
public:
ParentOne() {};
ParentOne() {}
#ifdef MAKE_WORK
virtual ~ParentOne() {};
virtual ~ParentOne() {}
#endif
private:
char SomeData[101];
......@@ -16,8 +16,8 @@ private:
class ParentTwo {
public:
ParentTwo() {};
virtual ~ParentTwo() {};
ParentTwo() {}
virtual ~ParentTwo() {}
private:
int MoreData[12];
virtual int foo() { return 0; }
......
......@@ -5,7 +5,7 @@ int main(void)
{
struct B
{
virtual void b1() { };
virtual void b1() { }
};
return 0;
......
......@@ -4,7 +4,7 @@
class Base {
int i;
public:
Base() { i = 42; };
Base() { i = 42; }
};
......@@ -17,8 +17,8 @@ public:
class Derived : public Base, public Mixin {
public:
Derived() { };
Derived & operator=(Mixin & m) { return *this; };
Derived() { }
Derived & operator=(Mixin & m) { return *this; }
};
......
......@@ -4,8 +4,8 @@ typedef int (A::*f_ptr) (void);
class B {
public:
B() {}; ~B() {};
B& dummy(f_ptr cb) { return *this; };
B() {} ~B() {}
B& dummy(f_ptr cb) { return *this; }
};
template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
......@@ -15,12 +15,12 @@ template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
class A {
public:
A() {}; ~A() {};
int ok() { return 0; };
A() {} ~A() {}
int ok() { return 0; }
A& call_it(B* s) {
call_dummy(s, &A::ok);
return *this;
};
}
};
int main() {
......
......@@ -3,7 +3,7 @@
class B {
public:
int Bi;
virtual int g() { return 0; };
virtual int g() { return 0; }
};
class D : private B {
......
......@@ -6,7 +6,7 @@ struct S {
++i;
if (i == 3)
throw 3;
};
}
S () {}
......
......@@ -4,10 +4,10 @@ int i;
struct S {
S () {
++i;
};
}
S (int) {
};
}
};
int main()
......
......@@ -24,7 +24,7 @@ struct baz : filler1, bar, filler2
struct foo : filler3, virtual baz, filler4
{
static void a();
void b() {};
void b() {}
int m;
};
......
......@@ -16,7 +16,7 @@ struct S {
struct T {
void g (S) {
};
}
};
struct U {
......
......@@ -96,7 +96,7 @@ test03 ()
// 2. crosscast
struct J {virtual ~J(){};};
struct J {virtual ~J(){}};
struct K : CC, private J {};
class KK : J, CC{};
......
......@@ -19,7 +19,7 @@ void error(int i)
// 1. downcast
// 1.1 single inheritance case
struct A {virtual ~A(){};int i;};
struct A {virtual ~A(){} int i;};
struct B : A {int i;};
struct C : B {int i;};
struct CC : C {};
......
......@@ -3,10 +3,10 @@
class foo {
public:
foo() {};
foo() {}
void throwMe () {
throw *this; // { dg-error "" } cannot be used in throw-expression
};
}
virtual void test () = 0;
};
......@@ -15,8 +15,8 @@ static int cnt = 0;
class Foo2
{
public:
Foo2() {};
~Foo2() { if (++cnt == 2) _exit (0); };
Foo2() {}
~Foo2() { if (++cnt == 2) _exit (0); }
};
static Foo2& GetFoo2()
......@@ -29,7 +29,7 @@ class Foo1
{
public:
Foo1() {}
~Foo1() { if (++cnt != 1) abort(); GetFoo2(); };
~Foo1() { if (++cnt != 1) abort(); GetFoo2(); }
};
int main( int argc, const char* argv[] )
......
......@@ -12,7 +12,7 @@ struct A
p = new T[size];
int foo;
foo = 5 * size;
};
}
};
struct B
......
// { dg-do run }
struct T { ~T() {}; };
struct T { ~T() {} };
int g ()
{
......
......@@ -23,7 +23,7 @@ struct baz : filler1, bar, filler2
struct foo : filler3, virtual baz, filler4
{
static void a();
void b() {};
void b() {}
int m;
};
......
// { dg-do link }
struct foo
{
foo() {};
~foo() {};
void func() { static foo x; };
foo() {}
~foo() {}
void func() { static foo x; }
};
int main()
......
......@@ -2,7 +2,7 @@
class A {
protected:
static void f() {};
static void f() {}
};
class B : A {
......
......@@ -40,7 +40,7 @@ template<typename X> struct auto_ptr {
};
struct Base { Base() {} virtual ~Base() {} };
struct Derived : Base { Derived() {}; };
struct Derived : Base { Derived() {} };
auto_ptr<Derived> f() { auto_ptr<Derived> null(0); return null; }
void g(auto_ptr<Derived>) { }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment