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> 2006-03-22 Paul Thomas <pault@gcc.gnu.org>
PR fortran/31193 PR fortran/31193
...@@ -10,7 +10,7 @@ struct c1 {}; ...@@ -10,7 +10,7 @@ struct c1 {};
struct c3 : virtual c1 struct c3 : virtual c1
{ {
virtual c1* f6() {}; virtual c1* f6() {}
int i; int i;
}; };
...@@ -18,7 +18,7 @@ struct c6 : virtual c3 { }; ...@@ -18,7 +18,7 @@ struct c6 : virtual c3 { };
struct c7 : c3 struct c7 : c3
{ {
virtual c3* f6() {}; virtual c3* f6() {}
}; };
struct c24 : virtual c7 struct c24 : virtual c7
......
...@@ -5,20 +5,20 @@ ...@@ -5,20 +5,20 @@
// PR 9433. segfault at runtime. // PR 9433. segfault at runtime.
struct A { virtual void f() {}; }; struct A { virtual void f() {} };
struct B {int b;}; 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 D : C {int d;};
struct E : C {int e;}; struct E : C {int e;};
struct F : protected D, E {int f;}; struct F : protected D, E {int f;};
struct H : virtual F {int h;}; struct H : virtual F {int h;};
struct I : H {int i;}; struct I : H {int i;};
struct J : H {int j;}; 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 M : K {int m;};
struct N : M {int n;}; struct N : M {int n;};
struct O : M {int o;}; 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() int main()
{ {
......
...@@ -10,8 +10,8 @@ struct foo { ...@@ -10,8 +10,8 @@ struct foo {
class Foobar : public foo { class Foobar : public foo {
public: public:
Foobar() { a = 1; b = 2; }; Foobar() { a = 1; b = 2; }
virtual ~Foobar() {}; virtual ~Foobar() {}
}; };
Foobar obj; Foobar obj;
......
...@@ -11,7 +11,7 @@ struct X ...@@ -11,7 +11,7 @@ struct X
struct Z : public X struct Z : public X
{ {
void a(void) {}; void a(void) {}
}; };
......
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
// PR c++/12699 ICE with covariancy // PR c++/12699 ICE with covariancy
struct c1 { struct c1 {
virtual void f1() const {}; virtual void f1() const {}
}; };
struct c5 {}; struct c5 {};
struct c6 : virtual c1 { struct c6 : virtual c1 {
virtual c5* f33() const {}; virtual c5* f33() const {}
}; };
struct c13 : virtual c5 { }; struct c13 : virtual c5 { };
struct c17 : virtual c6 struct c17 : virtual c6
{ {
virtual c13* f33() const {}; virtual c13* f33() const {}
}; };
...@@ -7,19 +7,19 @@ ...@@ -7,19 +7,19 @@
struct c2 { int i; }; struct c2 { int i; };
struct c1 { struct c1 {
virtual c2& f8() {}; virtual c2& f8() {}
}; };
struct c3 : c1, c2 { struct c3 : c1, c2 {
virtual c2& f8() {}; virtual c2& f8() {}
}; };
struct c11 : public c1 { struct c11 : public c1 {
virtual c3& f8() {}; virtual c3& f8() {}
}; };
struct c15 : virtual c3 { struct c15 : virtual c3 {
virtual c2& f8() {}; virtual c2& f8() {}
}; };
struct c18 : virtual c11 { struct c18 : virtual c11 {
......
...@@ -9,19 +9,19 @@ struct c1 {}; ...@@ -9,19 +9,19 @@ struct c1 {};
struct c0 { struct c0 {
int i; int i;
virtual c1& f10() {}; virtual c1& f10() {}
}; };
struct c2 : virtual c1, c0 { }; struct c2 : virtual c1, c0 { };
struct c6 : virtual c2, c0 { struct c6 : virtual c2, c0 {
virtual c2& f10() {}; virtual c2& f10() {}
}; };
struct c14 : virtual c2 { }; struct c14 : virtual c2 { };
struct c19 : virtual ::c6 { struct c19 : virtual ::c6 {
virtual class ::c14& f10() {}; virtual class ::c14& f10() {}
}; };
int main () int main ()
......
...@@ -9,8 +9,8 @@ protected: ...@@ -9,8 +9,8 @@ protected:
public: public:
Ptr(void) : ptr(0) { }; Ptr(void) : ptr(0) { }
Ptr(T * p) : ptr(p) { }; Ptr(T * p) : ptr(p) { }
~Ptr(void) { delete ptr; } ~Ptr(void) { delete ptr; }
......
...@@ -2,10 +2,10 @@ ...@@ -2,10 +2,10 @@
struct A {}; struct A {};
struct B : protected A { struct B : protected A {
B() {}; B() {}
B(const A& ) {}; B(const A& ) {}
private: private:
B(const B& ) {}; B(const B& ) {}
}; };
void foo(const A* ap) void foo(const A* ap)
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
struct T struct T
{ {
static void (*handler)(); static void (*handler)();
static void func() {}; static void func() {}
}; };
bool fail; bool fail;
......
...@@ -11,5 +11,5 @@ struct B2: public A {}; ...@@ -11,5 +11,5 @@ struct B2: public A {};
struct C: public B1, public B2 struct C: public B1, public B2
{ {
void g() { B1::f(); }; void g() { B1::f(); }
}; };
// { dg-do compile } // { dg-do compile }
// PR c++/7874: Don't inject friend functions into global name space. // 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() int main()
{ {
N::A<int> a; N::A<int> a;
......
...@@ -15,5 +15,5 @@ struct Derived : Base ...@@ -15,5 +15,5 @@ struct Derived : Base
{ {
Base::Baz (); // { dg-error "is not a member" "" } Base::Baz (); // { dg-error "is not a member" "" }
}; }
}; };
...@@ -11,7 +11,7 @@ struct B : A ...@@ -11,7 +11,7 @@ struct B : A
{ {
typedef A Parent; typedef A Parent;
B () : Parent () {}; B () : Parent () {}
}; };
class T class T
......
...@@ -13,5 +13,5 @@ struct foo { ...@@ -13,5 +13,5 @@ struct foo {
}; };
struct bar { struct bar {
int z; int z;
bar () { foo::x[z]; }; bar () { foo::x[z]; }
}; };
...@@ -20,6 +20,6 @@ class Camera2 ...@@ -20,6 +20,6 @@ class Camera2
{ {
public: public:
Camera2(const Hvec &basepos); 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(); ~Camera2();
}; };
...@@ -11,8 +11,8 @@ class BadStream : public ostringstream ...@@ -11,8 +11,8 @@ class BadStream : public ostringstream
{ {
public: public:
enum InternalEnum { VALUE = 0 }; enum InternalEnum { VALUE = 0 };
BadStream( InternalEnum e ) {}; BadStream( InternalEnum e ) {}
BadStream( InternalEnum e, int i ) {}; BadStream( InternalEnum e, int i ) {}
}; };
int main() int main()
......
...@@ -3,7 +3,7 @@ class JunkBase ...@@ -3,7 +3,7 @@ class JunkBase
public: public:
virtual void DoSomething( void ) = 0; virtual void DoSomething( void ) = 0;
protected: protected:
virtual ~JunkBase( void ) {}; virtual ~JunkBase( void ) {}
JunkBase( void ) {} JunkBase( void ) {}
}; };
......
...@@ -27,7 +27,7 @@ namespace N1 { ...@@ -27,7 +27,7 @@ namespace N1 {
B x; B x;
~C() { ~C() {
A y; A y;
}; }
}; };
} }
...@@ -59,7 +59,7 @@ namespace N2 { ...@@ -59,7 +59,7 @@ namespace N2 {
B<T> x; B<T> x;
~C() { ~C() {
A<T> y; A<T> y;
}; }
}; };
} }
......
...@@ -14,7 +14,7 @@ template <class T> struct A : T { ...@@ -14,7 +14,7 @@ template <class T> struct A : T {
struct B { struct B {
void f(B); void f(B);
void g(B) {}; void g(B) {}
}; };
void f(B) {} void f(B) {}
......
...@@ -14,5 +14,5 @@ template <typename P> class Y { ...@@ -14,5 +14,5 @@ template <typename P> class Y {
}; };
template <typename T> struct X<1,T> { 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 { ...@@ -9,13 +9,13 @@ template <typename K1> struct O {
template <typename T> template <typename T>
struct A : typename O<T>::template I<int> { // { dg-error "keyword 'typename' not allowed" } 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" } A() : typename O<T>::template I<int>() // { dg-error "keyword 'typename' not allowed" }
{}; {}
}; };
template <typename T> template <typename T>
struct B : O<T>::template I<int> { struct B : O<T>::template I<int> {
B() : O<T>::I<int>() // { dg-error "used as template|it is a template" "" } 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 } // { dg-bogus "end of input" "bogus token skipping in the parser" { xfail *-*-* } 17 }
class a {} a1; 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; } int main() { b <a1> b1; }
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
// PR c++/17154: Using declaration in partial class template specialization. // 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 <int numrows, class T> struct B {};
template <class T> struct B <3, T> : public A <3, T> { template <class T> struct B <3, T> : public A <3, T> {
using A <3, T>::test_A; 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 ...@@ -11,7 +11,7 @@ struct B : A
{ {
foo(__PRETTY_FUNCTION__); foo(__PRETTY_FUNCTION__);
return B(); return B();
}; }
}; };
B b=B().bar(); B b=B().bar();
...@@ -94,19 +94,19 @@ void check_placement_cookie (int i) ...@@ -94,19 +94,19 @@ void check_placement_cookie (int i)
struct X {}; struct X {};
template <typename T> 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. // 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 // Likewise, but this class needs a bigger cookie so that the array
// elements are correctly aligned. // 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 W1 { void operator delete[] (void *, size_t) {} };
struct W2 { void operator delete[] (void *) {}; struct W2 { void operator delete[] (void *) {}
void operator delete[] (void *, size_t) {}; }; void operator delete[] (void *, size_t) {} };
struct W3 { void operator delete[] (void *, size_t) {}; struct W3 { void operator delete[] (void *, size_t) {}
void operator delete[] (void *) {}; }; void operator delete[] (void *) {} };
struct W4 : public W1 {}; struct W4 : public W1 {};
struct V { void *operator new[] (size_t s, void *p) struct V { void *operator new[] (size_t s, void *p)
......
...@@ -17,35 +17,35 @@ struct B8 : A {}; ...@@ -17,35 +17,35 @@ struct B8 : A {};
struct C1 : B1 struct C1 : B1
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C2 : B1, B2 struct C2 : B1, B2
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C3 : B1, B2, B3 struct C3 : B1, B2, B3
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C4 : B1, B2, B3, B4 struct C4 : B1, B2, B3, B4
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C5 : B1, B2, B3, B4, B5 struct C5 : B1, B2, B3, B4, B5
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C6 : B1, B2, B3, B4, B5, B6 struct C6 : B1, B2, B3, B4, B5, B6
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct C7 : B1, B2, B3, B4, B5, B6, B7 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 struct C8 : B1, B2, B3, B4, B5, B6, B7, B8
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct D1 : virtual C1 {}; struct D1 : virtual C1 {};
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
struct A1 struct A1
{ {
virtual void Foo () {}; virtual void Foo () {}
}; };
struct A : A1 struct A : A1
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class A { class A {
char str[10]; char str[10];
public: public:
char* m1 () { return str;}; char* m1 () { return str;}
}; };
class C : public A { class C : public A {
......
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
class ObjectExchange class ObjectExchange
{ {
public: public:
ObjectExchange() {}; ObjectExchange() {}
ExchangeableList i_theWatchList; // Instruments being monitored ExchangeableList i_theWatchList; // Instruments being monitored
}; };
......
...@@ -35,10 +35,10 @@ class BaseClass { ...@@ -35,10 +35,10 @@ class BaseClass {
public: public:
BaseClass( const BaseClass& ir ) : i(ir.i) {}; BaseClass( const BaseClass& ir ) : i(ir.i) {}
BaseClass() : i(5) {}; BaseClass() : i(5) {}
virtual int virtMember() { return( 999 ); }; virtual int virtMember() { return( 999 ); }
void Increm( int r ); void Increm( int r );
}; };
...@@ -54,7 +54,7 @@ void BaseClass::Increm( int r ) ...@@ -54,7 +54,7 @@ void BaseClass::Increm( int r )
class DerivedClass : public BaseClass { class DerivedClass : public BaseClass {
public: public:
int virtMember() { return( 30 ); }; int virtMember() { return( 30 ); }
}; };
int operator != (const BaseClass irv, int x) { return irv.i != x; } int operator != (const BaseClass irv, int x) { return irv.i != x; }
......
...@@ -8,7 +8,7 @@ void die () { printf ("FAIL\n"); exit (1); } ...@@ -8,7 +8,7 @@ void die () { printf ("FAIL\n"); exit (1); }
class B { class B {
public: public:
B() {} B() {}
B(const B &) { printf ("PASS\n"); exit (0); }; B(const B &) { printf ("PASS\n"); exit (0); }
private: private:
int x; int x;
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class Graph { class Graph {
public: public:
unsigned char N; 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" } Graph::Graph(void) // { dg-error "return type|redefinition|semicolon" }
......
...@@ -24,8 +24,8 @@ public: ...@@ -24,8 +24,8 @@ public:
template< class T, int n> class Implicit : public T { template< class T, int n> class Implicit : public T {
public: public:
typedef typename T::BASE BASE; typedef typename T::BASE BASE;
Implicit(BASE value ): T(value) {}; Implicit(BASE value ): T(value) {}
Implicit() : T() {}; Implicit() : T() {}
int myTag() { return n; } int myTag() { return n; }
void encode() { T::encode(); } void encode() { T::encode(); }
BASE operator=(BASE t) { return T::operator=(t); } BASE operator=(BASE t) { return T::operator=(t); }
......
...@@ -17,7 +17,7 @@ public: ...@@ -17,7 +17,7 @@ public:
C &operator = (const C &x) C &operator = (const C &x)
{ {
return *this; return *this;
}; }
}; };
C &(C::*DD)(const C &x) = &C::operator=; C &(C::*DD)(const C &x) = &C::operator=;
......
...@@ -10,7 +10,7 @@ ...@@ -10,7 +10,7 @@
class test{ class test{
public: public:
int flags; int flags;
test() {}; test() {}
}; };
int main() int main()
......
...@@ -5,7 +5,7 @@ class foo_int ...@@ -5,7 +5,7 @@ class foo_int
public: public:
int & i; int & i;
foo_int (int &j) : i(j) {}; foo_int (int &j) : i(j) {}
void inc () { i++; } void inc () { i++; }
}; };
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// GROUPS passed overloading // GROUPS passed overloading
typedef struct{double re,im;} complex; typedef struct{double re,im;} complex;
class Complex{public:double re,im; 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;} void zxcvbnm(int n,...){n=1;}
int main(){complex c; Complex C; int main(){complex c; Complex C;
zxcvbnm(1,c); zxcvbnm(1,c);
......
...@@ -34,7 +34,7 @@ int aCallback<Called>::callback() ...@@ -34,7 +34,7 @@ int aCallback<Called>::callback()
struct myStruct struct myStruct
{ {
int action() {return 24;}; int action() {return 24;}
}; };
int main() int main()
......
// { dg-do assemble } // { dg-do compile }
// { dg-options "-Wall -Wextra" }
// GROUPS passed warnings // GROUPS passed warnings
class K { class K {
public: public:
......
...@@ -13,7 +13,7 @@ struct myExcRaiser { ...@@ -13,7 +13,7 @@ struct myExcRaiser {
}; };
struct stackObj { struct stackObj {
~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); }; ~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); }
}; };
int test() int test()
......
...@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...); ...@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...);
struct E { struct E {
int x; int x;
E(int i) { x = i; }; E(int i) { x = i; }
}; };
int main() int main()
......
...@@ -13,8 +13,8 @@ static int ok = 0; ...@@ -13,8 +13,8 @@ static int ok = 0;
struct A struct A
{ {
A (){}; A (){}
virtual ~A () {}; virtual ~A () {}
}; };
struct B : virtual A struct B : virtual A
......
...@@ -4,6 +4,6 @@ void Foo (void) ...@@ -4,6 +4,6 @@ void Foo (void)
{ {
class C { class C {
public: public:
virtual int foo (void) { return 0; }; virtual int foo (void) { return 0; }
}; };
} }
...@@ -8,7 +8,7 @@ class Char ...@@ -8,7 +8,7 @@ class Char
protected: protected:
char rep; char rep;
public: public:
Char (const char ) {}; Char (const char ) {}
operator char() const; operator char() const;
void operator -= (const Char ); void operator -= (const Char );
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// PRMS Id: 5070 (testcase 1) // PRMS Id: 5070 (testcase 1)
struct foo { struct foo {
foo(int x = 0) {}; foo(int x = 0) {}
int IsAlive(void) { return 1; } int IsAlive(void) { return 1; }
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class X { // { dg-error "assignment" } class X { // { dg-error "assignment" }
int& a; int& a;
public: public:
X(int& i): a(i) { }; X(int& i): a(i) { }
}; };
void foo () void foo ()
......
...@@ -2,6 +2,6 @@ ...@@ -2,6 +2,6 @@
// Bug: g++ fails to catch the ambiguity below. // Bug: g++ fails to catch the ambiguity below.
struct A { struct A {
operator int () { return 1; }; operator int () { return 1; }
operator int &() { return 1; }; // { dg-error "" } operator int &() { return 1; } // { dg-error "" }
}; };
...@@ -6,7 +6,7 @@ class Fu ...@@ -6,7 +6,7 @@ class Fu
{ {
int val; int val;
public: public:
Fu(int i) : val(i) { }; Fu(int i) : val(i) { }
void print() { } void print() { }
}; };
......
...@@ -31,7 +31,7 @@ int aCallback<Called>::callback() ...@@ -31,7 +31,7 @@ int aCallback<Called>::callback()
struct myStruct struct myStruct
{ {
int action() {return 0;}; int action() {return 0;}
}; };
int main() int main()
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class Parent { class Parent {
public: public:
void DoSomething() { return; }; void DoSomething() { return; }
int i; int i;
}; };
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
struct A {}; struct A {};
struct B { struct B {
virtual void foo () {}; virtual void foo () {}
}; };
struct C : public B, public A {}; struct C : public B, public A {};
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// PRMS id: 10912 // PRMS id: 10912
struct A { struct A {
A() { i=10; }; A() { i=10; }
int i; int i;
}; };
struct B : public A {}; struct B : public A {};
......
...@@ -7,8 +7,8 @@ struct A ...@@ -7,8 +7,8 @@ struct A
struct B struct B
{ {
int f; int f;
B() : f(0) {}; B() : f(0) {}
void g() { f = 0; }; void g() { f = 0; }
}; };
void f(); void f();
void f(int); void f(int);
......
...@@ -11,5 +11,5 @@ private: ...@@ -11,5 +11,5 @@ private:
class DbmItem: public RefCount{ class DbmItem: public RefCount{
public: public:
DbmItem(): RefCount() {}; DbmItem(): RefCount() {}
}; };
...@@ -29,13 +29,13 @@ void Test<T>::doThat() ...@@ -29,13 +29,13 @@ void Test<T>::doThat()
class A class A
{ {
public: public:
void thiss() {}; void thiss() {}
}; };
class B class B
{ {
public: public:
void that() {}; void that() {}
}; };
int main() int main()
......
...@@ -7,7 +7,7 @@ class A ...@@ -7,7 +7,7 @@ class A
public: public:
enum muni {X, Y}; enum muni {X, Y};
muni e() { return X; }; muni e() { return X; }
muni f(); muni f();
}; };
......
...@@ -24,15 +24,15 @@ public: ...@@ -24,15 +24,15 @@ public:
class C: public A, public B class C: public A, public B
{ {
public: public:
virtual void a2() {}; virtual void a2() {}
virtual void b2() {}; virtual void b2() {}
}; };
class D : public C class D : public C
{ {
public: public:
virtual void a1() {}; virtual void a1() {}
virtual void b1() {}; virtual void b1() {}
}; };
int main() int main()
......
...@@ -16,7 +16,7 @@ class VObject { ...@@ -16,7 +16,7 @@ class VObject {
boolean perform(method ); boolean perform(method );
boolean perform(method , long); boolean perform(method , long);
void affectMethod(method ); void affectMethod(method );
void dummy(){}; void dummy(){}
}; };
......
...@@ -70,7 +70,7 @@ class Vector ...@@ -70,7 +70,7 @@ class Vector
Vector( int, double *, int beg = 0 ); Vector( int, double *, int beg = 0 );
Vector( const Vector & ); Vector( const Vector & );
Vector &operator=( const Vector & ); Vector &operator=( const Vector & );
~Vector() { if(r) r->unrefer(); }; ~Vector() { if(r) r->unrefer(); }
int row() const { return 19; } int row() const { return 19; }
int dim() const { return 10; } int dim() const { return 10; }
......
...@@ -8,19 +8,19 @@ class bla { ...@@ -8,19 +8,19 @@ class bla {
public: 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 { class ulk {
public: 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 // ^ interestingly, the code compiles right if
// this & is deleted (and therefore the parameter // this & is deleted (and therefore the parameter
// passed as value) // passed as value)
......
...@@ -15,5 +15,5 @@ class T { ...@@ -15,5 +15,5 @@ class T {
class T2 { class T2 {
friend void f (int& i) { // BOGUS - friend void f (int& i) { // BOGUS -
i = 1; i = 1;
}; }
}; };
...@@ -15,7 +15,7 @@ class Traversable { ...@@ -15,7 +15,7 @@ class Traversable {
public: public:
virtual const T item() const = 0; virtual const T item() const = 0;
virtual const bool off() const = 0; virtual const bool off() const = 0;
virtual ~Traversable() { }; virtual ~Traversable() { }
}; };
class Chain : public Traversable { class Chain : public Traversable {
...@@ -47,7 +47,7 @@ protected: ...@@ -47,7 +47,7 @@ protected:
virtual void go_offright() const = 0; virtual void go_offright() const = 0;
virtual void copy(const List& other) = 0; virtual void copy(const List& other) = 0;
public: public:
List() : item_count(0), cursor_position(0) { }; List() : item_count(0), cursor_position(0) { }
virtual const int count() const; virtual const int count() const;
virtual const bool empty() const; virtual const bool empty() const;
virtual const bool isfirst() const; virtual const bool isfirst() const;
...@@ -105,7 +105,7 @@ protected: ...@@ -105,7 +105,7 @@ protected:
virtual void copy(const List& other); virtual void copy(const List& other);
public: public:
Fixed_List(const List& other); 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 bool empty() const;
virtual const int count() const; virtual const int count() const;
virtual const T item() const; virtual const T item() const;
...@@ -113,7 +113,7 @@ public: ...@@ -113,7 +113,7 @@ public:
virtual void move(const int index) const; virtual void move(const int index) const;
virtual void put(const T value); virtual void put(const T value);
virtual void put_i_th(const T value, const int index); 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); Fixed_List& operator=(const List& other);
}; };
......
...@@ -15,5 +15,5 @@ class B: public A { ...@@ -15,5 +15,5 @@ class B: public A {
public: public:
B () { B () {
!(A::j); !(A::j);
}; }
}; };
...@@ -18,7 +18,7 @@ struct fcell { ...@@ -18,7 +18,7 @@ struct fcell {
class FStack { class FStack {
public: public:
struct fcell *top; struct fcell *top;
FStack() { top = NULL ; } ; FStack() { top = NULL ; }
inline void push(FILE * fd1, int line_num, char *fname = NULL) { inline void push(FILE * fd1, int line_num, char *fname = NULL) {
struct fcell *tmp = new struct fcell; struct fcell *tmp = new struct fcell;
tmp->fd = fd1; tmp->fd = fd1;
......
...@@ -14,7 +14,7 @@ class Vector { ...@@ -14,7 +14,7 @@ class Vector {
int size; int size;
Complex *v; Complex *v;
public: 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 ~Vector() { delete [size] v;}// { dg-error "" } warning
}; };
......
...@@ -19,7 +19,7 @@ public: ...@@ -19,7 +19,7 @@ public:
class l class l
{ {
public: public:
void s() {}; void s() {}
}; };
extern t<l> g; extern t<l> g;
...@@ -28,5 +28,5 @@ class p ...@@ -28,5 +28,5 @@ class p
{ {
public: public:
void *h; void *h;
s *a() {return (s *) h;}; s *a() {return (s *) h;}
}; };
...@@ -11,12 +11,12 @@ void f() ...@@ -11,12 +11,12 @@ void f()
{ {
{ {
struct A { struct A {
A() {}; A() {}
} a; } a;
}; };
{ {
struct A { struct A {
A() {}; A() {}
} a ; } a ;
}; };
} }
...@@ -12,7 +12,7 @@ class doubleclass ...@@ -12,7 +12,7 @@ class doubleclass
{ {
public: public:
double d; double d;
doubleclass(double x = 0) { d = x; }; doubleclass(double x = 0) { d = x; }
}; };
class test class test
......
...@@ -8,17 +8,17 @@ class base { ...@@ -8,17 +8,17 @@ class base {
//========== //==========
void base_priv(const char * n) void base_priv(const char * n)
{ std::cout << "base_priv called from: " << n << "\n"; }; { std::cout << "base_priv called from: " << n << "\n"; }
protected: protected:
void base_prot(const char * n) void base_prot(const char * n)
{ std::cout << "base_prot called from: " << n << "\n"; }; { std::cout << "base_prot called from: " << n << "\n"; }
public: public:
void base_publ(const char * n) 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); } void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); }
......
...@@ -5,8 +5,8 @@ ...@@ -5,8 +5,8 @@
class base { class base {
public: public:
void f1 () { std::cout << "f1" << std::endl; }; void f1 () { std::cout << "f1" << std::endl; }
void f2 () { std::cout << "f2" << std::endl; }; void f2 () { std::cout << "f2" << std::endl; }
}; };
class deriv : public base { class deriv : public base {
......
...@@ -8,17 +8,17 @@ class base { ...@@ -8,17 +8,17 @@ class base {
//========== //==========
void base_priv(const char * n) void base_priv(const char * n)
{ std::cout << "base_priv called from: " << n << "\n"; }; { std::cout << "base_priv called from: " << n << "\n"; }
protected: protected:
void base_prot(const char * n) void base_prot(const char * n)
{ std::cout << "base_prot called from: " << n << "\n"; }; { std::cout << "base_prot called from: " << n << "\n"; }
public: public:
void base_publ(const char * n) 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); } void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); }
......
...@@ -21,5 +21,5 @@ extern "C" int printf( const char *, ...); ...@@ -21,5 +21,5 @@ extern "C" int printf( const char *, ...);
class E : public C { class E : public C {
void f() { void f() {
printf( "%d\n", b);// { dg-error "" } .* printf( "%d\n", b);// { dg-error "" } .*
}; }
}; };
...@@ -10,7 +10,7 @@ struct a ...@@ -10,7 +10,7 @@ struct a
struct b struct b
{ {
virtual void g() { }; virtual void g() { }
}; };
struct c: public a, public b struct c: public a, public b
......
...@@ -17,7 +17,7 @@ typedef void (D::*DPROC)(void); ...@@ -17,7 +17,7 @@ typedef void (D::*DPROC)(void);
union AFX_PMSG { union AFX_PMSG {
public: public:
AFX_PMSG () {}; AFX_PMSG () {}
AFX_PMSG ( BPROC bpr ) { bfn = bpr ; } AFX_PMSG ( BPROC bpr ) { bfn = bpr ; }
operator BPROC() { return bfn; } operator BPROC() { return bfn; }
......
...@@ -5,8 +5,8 @@ extern "C" int printf (const char *, ...); ...@@ -5,8 +5,8 @@ extern "C" int printf (const char *, ...);
class myFoundation { class myFoundation {
protected: protected:
myFoundation () { count = 0; }; myFoundation () { count = 0; }
virtual ~myFoundation () {}; virtual ~myFoundation () {}
public: public:
void addRef () { ++count; } void addRef () { ++count; }
...@@ -19,8 +19,8 @@ private: ...@@ -19,8 +19,8 @@ private:
class firstIntermediate :virtual public myFoundation { class firstIntermediate :virtual public myFoundation {
public: public:
firstIntermediate () {}; firstIntermediate () {}
~firstIntermediate () {}; ~firstIntermediate () {}
void bar () { printf ("Bar\n"); } void bar () { printf ("Bar\n"); }
}; };
...@@ -28,58 +28,58 @@ public: ...@@ -28,58 +28,58 @@ public:
class firstBase : public firstIntermediate { class firstBase : public firstIntermediate {
public: public:
firstBase () {}; firstBase () {}
~firstBase () {}; ~firstBase () {}
virtual void g () {}; virtual void g () {}
}; };
class secondIntermediate : virtual public myFoundation { class secondIntermediate : virtual public myFoundation {
public: public:
secondIntermediate () {}; secondIntermediate () {}
~secondIntermediate () {}; ~secondIntermediate () {}
virtual void h () {}; virtual void h () {}
}; };
class secondBase : public secondIntermediate { class secondBase : public secondIntermediate {
public: public:
secondBase () {}; secondBase () {}
~secondBase () {}; ~secondBase () {}
virtual void h () {}; virtual void h () {}
}; };
class typeInterface : virtual public firstBase { class typeInterface : virtual public firstBase {
public: public:
typeInterface () {}; typeInterface () {}
~typeInterface () {}; ~typeInterface () {}
virtual void i () {}; virtual void i () {}
}; };
class classServices : virtual public firstBase, class classServices : virtual public firstBase,
public secondBase { public secondBase {
public: public:
classServices () {}; classServices () {}
~classServices () {}; ~classServices () {}
virtual void j () {}; virtual void j () {}
}; };
class classImplementation : public typeInterface, class classImplementation : public typeInterface,
public classServices { public classServices {
public: public:
classImplementation () {}; classImplementation () {}
~classImplementation () {}; ~classImplementation () {}
void g () {}; void g () {}
void h () {}; void h () {}
void i () {}; void i () {}
void j () {}; void j () {}
}; };
int main () { int main () {
......
...@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...); ...@@ -5,7 +5,7 @@ extern "C" int printf (const char *, ...);
class A class A
{ {
public: public:
virtual ~A(){}; virtual ~A(){}
virtual int type(void) virtual int type(void)
{ {
return -1; return -1;
...@@ -15,7 +15,7 @@ public: ...@@ -15,7 +15,7 @@ public:
class B class B
{ {
public: public:
virtual ~B(){}; virtual ~B(){}
}; };
......
...@@ -12,9 +12,9 @@ struct link { ...@@ -12,9 +12,9 @@ struct link {
link *prev; link *prev;
link(const T& t): item(t), prev(0), next(0) 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) link(const T& t, link<T> *p, link<T> *n): item(t), prev(p), next(n)
{ }; { }
}; };
template<class T> template<class T>
...@@ -182,9 +182,9 @@ template<class T> ...@@ -182,9 +182,9 @@ template<class T>
class List_DLS: public List_DL<T> { class List_DLS: public List_DL<T> {
public: public:
List_DLS(): List_DL<T>() List_DLS(): List_DL<T>()
{ }; { }
List_DLS(const List_DLS& other): List_DL<T>(other) List_DLS(const List_DLS& other): List_DL<T>(other)
{ }; { }
bool contains(const T& item) const bool contains(const T& item) const
{ return search(item) != 0 ? TRUE: FALSE; } { return search(item) != 0 ? TRUE: FALSE; }
...@@ -206,9 +206,9 @@ template<class T> ...@@ -206,9 +206,9 @@ template<class T>
class List_DLSp: public List_DL<T> { class List_DLSp: public List_DL<T> {
public: public:
List_DLSp(): List_DL<T>() List_DLSp(): List_DL<T>()
{ }; { }
List_DLSp(const List_DLSp& other): List_DL<T>(other) List_DLSp(const List_DLSp& other): List_DL<T>(other)
{ }; { }
bool contains(const T& item) const bool contains(const T& item) const
#ifndef INTERNAL_ERROR #ifndef INTERNAL_ERROR
...@@ -335,9 +335,9 @@ struct vertex { ...@@ -335,9 +335,9 @@ struct vertex {
List_DL<vertex<T> *> fanout; List_DL<vertex<T> *> fanout;
vertex(): item(), fanout() // { dg-bogus "" } vertex(): item(), fanout() // { dg-bogus "" }
{ }; { }
vertex(const T& i): item(), fanout() // { dg-bogus "" } vertex(const T& i): item(), fanout() // { dg-bogus "" }
{ }; { }
}; };
template<class T> template<class T>
......
...@@ -4,17 +4,17 @@ ...@@ -4,17 +4,17 @@
extern "C" int printf(const char *, ...); extern "C" int printf(const char *, ...);
struct A { struct A {
void print() {printf("A");}; void print() {printf("A");}
}; };
struct B : A { struct B : A {
typedef A superB; typedef A superB;
void print() {superB::print(); printf("B");}; void print() {superB::print(); printf("B");}
}; };
struct C : B { struct C : B {
typedef B superC; typedef B superC;
void print() {superC::print(); printf("C");}; void print() {superC::print(); printf("C");}
}; };
int main () int main ()
......
...@@ -5,7 +5,7 @@ int bad; ...@@ -5,7 +5,7 @@ int bad;
class A { class A {
public: public:
virtual void dummy (){}; virtual void dummy (){}
}; };
class B { class B {
...@@ -15,12 +15,12 @@ public: ...@@ -15,12 +15,12 @@ public:
class C : public A, public B { class C : public A, public B {
public: public:
void f(void) { bad=1; }; void f(void) { bad=1; }
}; };
class D : public C { class D : public C {
public: public:
void f(void) { }; void f(void) { }
}; };
class E : public D { }; class E : public D { };
......
...@@ -6,9 +6,9 @@ void *vp = 0; ...@@ -6,9 +6,9 @@ void *vp = 0;
class ParentOne { class ParentOne {
public: public:
ParentOne() {}; ParentOne() {}
#ifdef MAKE_WORK #ifdef MAKE_WORK
virtual ~ParentOne() {}; virtual ~ParentOne() {}
#endif #endif
private: private:
char SomeData[101]; char SomeData[101];
...@@ -16,8 +16,8 @@ private: ...@@ -16,8 +16,8 @@ private:
class ParentTwo { class ParentTwo {
public: public:
ParentTwo() {}; ParentTwo() {}
virtual ~ParentTwo() {}; virtual ~ParentTwo() {}
private: private:
int MoreData[12]; int MoreData[12];
virtual int foo() { return 0; } virtual int foo() { return 0; }
......
...@@ -5,7 +5,7 @@ int main(void) ...@@ -5,7 +5,7 @@ int main(void)
{ {
struct B struct B
{ {
virtual void b1() { }; virtual void b1() { }
}; };
return 0; return 0;
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class Base { class Base {
int i; int i;
public: public:
Base() { i = 42; }; Base() { i = 42; }
}; };
...@@ -17,8 +17,8 @@ public: ...@@ -17,8 +17,8 @@ public:
class Derived : public Base, public Mixin { class Derived : public Base, public Mixin {
public: public:
Derived() { }; Derived() { }
Derived & operator=(Mixin & m) { return *this; }; Derived & operator=(Mixin & m) { return *this; }
}; };
......
...@@ -4,8 +4,8 @@ typedef int (A::*f_ptr) (void); ...@@ -4,8 +4,8 @@ typedef int (A::*f_ptr) (void);
class B { class B {
public: public:
B() {}; ~B() {}; B() {} ~B() {}
B& dummy(f_ptr cb) { return *this; }; B& dummy(f_ptr cb) { return *this; }
}; };
template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) { 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) { ...@@ -15,12 +15,12 @@ template<class SP, class CB> SP& call_dummy(SP* sp, CB cb) {
class A { class A {
public: public:
A() {}; ~A() {}; A() {} ~A() {}
int ok() { return 0; }; int ok() { return 0; }
A& call_it(B* s) { A& call_it(B* s) {
call_dummy(s, &A::ok); call_dummy(s, &A::ok);
return *this; return *this;
}; }
}; };
int main() { int main() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class B { class B {
public: public:
int Bi; int Bi;
virtual int g() { return 0; }; virtual int g() { return 0; }
}; };
class D : private B { class D : private B {
......
...@@ -6,7 +6,7 @@ struct S { ...@@ -6,7 +6,7 @@ struct S {
++i; ++i;
if (i == 3) if (i == 3)
throw 3; throw 3;
}; }
S () {} S () {}
......
...@@ -4,10 +4,10 @@ int i; ...@@ -4,10 +4,10 @@ int i;
struct S { struct S {
S () { S () {
++i; ++i;
}; }
S (int) { S (int) {
}; }
}; };
int main() int main()
......
...@@ -24,7 +24,7 @@ struct baz : filler1, bar, filler2 ...@@ -24,7 +24,7 @@ struct baz : filler1, bar, filler2
struct foo : filler3, virtual baz, filler4 struct foo : filler3, virtual baz, filler4
{ {
static void a(); static void a();
void b() {}; void b() {}
int m; int m;
}; };
......
...@@ -16,7 +16,7 @@ struct S { ...@@ -16,7 +16,7 @@ struct S {
struct T { struct T {
void g (S) { void g (S) {
}; }
}; };
struct U { struct U {
......
...@@ -96,7 +96,7 @@ test03 () ...@@ -96,7 +96,7 @@ test03 ()
// 2. crosscast // 2. crosscast
struct J {virtual ~J(){};}; struct J {virtual ~J(){}};
struct K : CC, private J {}; struct K : CC, private J {};
class KK : J, CC{}; class KK : J, CC{};
......
...@@ -19,7 +19,7 @@ void error(int i) ...@@ -19,7 +19,7 @@ void error(int i)
// 1. downcast // 1. downcast
// 1.1 single inheritance case // 1.1 single inheritance case
struct A {virtual ~A(){};int i;}; struct A {virtual ~A(){} int i;};
struct B : A {int i;}; struct B : A {int i;};
struct C : B {int i;}; struct C : B {int i;};
struct CC : C {}; struct CC : C {};
......
...@@ -3,10 +3,10 @@ ...@@ -3,10 +3,10 @@
class foo { class foo {
public: public:
foo() {}; foo() {}
void throwMe () { void throwMe () {
throw *this; // { dg-error "" } cannot be used in throw-expression throw *this; // { dg-error "" } cannot be used in throw-expression
}; }
virtual void test () = 0; virtual void test () = 0;
}; };
...@@ -15,8 +15,8 @@ static int cnt = 0; ...@@ -15,8 +15,8 @@ static int cnt = 0;
class Foo2 class Foo2
{ {
public: public:
Foo2() {}; Foo2() {}
~Foo2() { if (++cnt == 2) _exit (0); }; ~Foo2() { if (++cnt == 2) _exit (0); }
}; };
static Foo2& GetFoo2() static Foo2& GetFoo2()
...@@ -29,7 +29,7 @@ class Foo1 ...@@ -29,7 +29,7 @@ class Foo1
{ {
public: public:
Foo1() {} Foo1() {}
~Foo1() { if (++cnt != 1) abort(); GetFoo2(); }; ~Foo1() { if (++cnt != 1) abort(); GetFoo2(); }
}; };
int main( int argc, const char* argv[] ) int main( int argc, const char* argv[] )
......
...@@ -12,7 +12,7 @@ struct A ...@@ -12,7 +12,7 @@ struct A
p = new T[size]; p = new T[size];
int foo; int foo;
foo = 5 * size; foo = 5 * size;
}; }
}; };
struct B struct B
......
// { dg-do run } // { dg-do run }
struct T { ~T() {}; }; struct T { ~T() {} };
int g () int g ()
{ {
......
...@@ -23,7 +23,7 @@ struct baz : filler1, bar, filler2 ...@@ -23,7 +23,7 @@ struct baz : filler1, bar, filler2
struct foo : filler3, virtual baz, filler4 struct foo : filler3, virtual baz, filler4
{ {
static void a(); static void a();
void b() {}; void b() {}
int m; int m;
}; };
......
// { dg-do link } // { dg-do link }
struct foo struct foo
{ {
foo() {}; foo() {}
~foo() {}; ~foo() {}
void func() { static foo x; }; void func() { static foo x; }
}; };
int main() int main()
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class A { class A {
protected: protected:
static void f() {}; static void f() {}
}; };
class B : A { class B : A {
......
...@@ -40,7 +40,7 @@ template<typename X> struct auto_ptr { ...@@ -40,7 +40,7 @@ template<typename X> struct auto_ptr {
}; };
struct Base { Base() {} virtual ~Base() {} }; struct Base { Base() {} virtual ~Base() {} };
struct Derived : Base { Derived() {}; }; struct Derived : Base { Derived() {} };
auto_ptr<Derived> f() { auto_ptr<Derived> null(0); return null; } auto_ptr<Derived> f() { auto_ptr<Derived> null(0); return null; }
void g(auto_ptr<Derived>) { } void g(auto_ptr<Derived>) { }
......
...@@ -9,7 +9,7 @@ void f() ...@@ -9,7 +9,7 @@ void f()
void g() { void g() {
C e; C e;
e.c = 3; e.c = 3;
}; }
}; };
S s; S s;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Origin: Leon Bottou <leonb@research.att.com> // Origin: Leon Bottou <leonb@research.att.com>
class AA { protected: class AA { protected:
template <class T> struct BB { T x; BB(const T &x) : x(x) { }; }; template <class T> struct BB { T x; BB(const T &x) : x(x) { } };
template <class T> struct CC : public BB<T> { CC(const T &x) : BB<T>(x) { }; template <class T> struct CC : public BB<T> { CC(const T &x) : BB<T>(x) { }
}; };
}; };
...@@ -5,7 +5,7 @@ template <class T> ...@@ -5,7 +5,7 @@ template <class T>
struct A struct A
{ {
public: public:
~A() { }; ~A() { }
class B; class B;
}; };
......
...@@ -11,7 +11,7 @@ private: ...@@ -11,7 +11,7 @@ private:
} val; } val;
val.i = x; val.i = x;
return val.c; return val.c;
}; }
public: public:
b() { b() {
......
...@@ -18,7 +18,7 @@ class PK_FixedLengthEncryptor : public virtual PK_Encryptor, public virtual PK_F ...@@ -18,7 +18,7 @@ class PK_FixedLengthEncryptor : public virtual PK_Encryptor, public virtual PK_F
class PK_SignatureSystem class PK_SignatureSystem
{ {
public: public:
virtual ~PK_SignatureSystem() {}; virtual ~PK_SignatureSystem() {}
}; };
class PK_Signer : public virtual PK_SignatureSystem class PK_Signer : public virtual PK_SignatureSystem
{ {
......
...@@ -13,7 +13,7 @@ typedef int F(); ...@@ -13,7 +13,7 @@ typedef int F();
template<class T, typename A<T>::F f> template<class T, typename A<T>::F f>
struct B { struct B {
static int g() { return f(); }; static int g() { return f(); }
}; };
int f() { return 0; } int f() { return 0; }
......
...@@ -7,8 +7,8 @@ template <int N> struct A { ...@@ -7,8 +7,8 @@ template <int N> struct A {
}; };
template <int N> struct B { template <int N> struct B {
B () { }; B () { }
B (const A<N> &) { }; B (const A<N> &) { }
B (const A<N-1> &, int); B (const A<N-1> &, int);
}; };
......
...@@ -13,7 +13,7 @@ int r = 1; ...@@ -13,7 +13,7 @@ int r = 1;
struct A struct A
{ {
void f(){}; void f(){}
A(){ ++r; } A(){ ++r; }
~A(){ r -= 2; _exit (r); } ~A(){ r -= 2; _exit (r); }
}; };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
class Base { class Base {
public: public:
class Bar { public: virtual ~Bar() {}; }; class Bar { public: virtual ~Bar() {} };
}; };
class Derived : public Base { class Derived : public Base {
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
#include <stdarg.h> #include <stdarg.h>
struct A { struct A {
virtual ~A () {}; virtual ~A () {}
}; };
template <class Type> template <class Type>
......
...@@ -11,7 +11,7 @@ private: ...@@ -11,7 +11,7 @@ private:
} val; } val;
val.i = x; val.i = x;
return val.c; return val.c;
}; }
public: public:
b() { b() {
......
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
// friend int f(); // friend int f();
static int x; static int x;
public: public:
static int f() {return foo::f();}; static int f() {return foo::f();}
}; };
}; };
......
// { dg-do assemble } // { dg-do assemble }
class Base { class Base {
public: public:
class Bar { public: virtual ~Bar() {}; }; class Bar { public: virtual ~Bar() {} };
}; };
class Derived : public Base { class Derived : public Base {
......
...@@ -13,8 +13,8 @@ using namespace std; ...@@ -13,8 +13,8 @@ using namespace std;
template <class T> class Expr template <class T> class Expr
{ {
public : public :
Expr(){}; Expr(){}
Expr(const T&){}; Expr(const T&){}
}; };
template <class T > template <class T >
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
class A1 { class A1 {
friend class B; friend class B;
public: public:
virtual void foo() {}; virtual void foo() {}
}; };
class A2 : public virtual A1 {friend class B;}; class A2 : public virtual A1 {friend class B;};
...@@ -14,7 +14,7 @@ class A3 : public virtual A1, private A2 {friend class B;}; ...@@ -14,7 +14,7 @@ class A3 : public virtual A1, private A2 {friend class B;};
class B class B
{ {
public: public:
B(A1* a) : itsA(dynamic_cast<A2*>(a)) {}; B(A1* a) : itsA(dynamic_cast<A2*>(a)) {}
A2* itsA; A2* itsA;
}; };
......
...@@ -23,7 +23,7 @@ private: ...@@ -23,7 +23,7 @@ private:
val.i = x; val.i = x;
std::swap(val.c[0], val.c[1]); std::swap(val.c[0], val.c[1]);
return val.i; return val.i;
}; }
_eb91_int16_t change_endian(_eb91_int16_t x) _eb91_int16_t change_endian(_eb91_int16_t x)
{ {
...@@ -34,7 +34,7 @@ private: ...@@ -34,7 +34,7 @@ private:
val.i = x; val.i = x;
std::swap(val.c[0], val.c[1]); std::swap(val.c[0], val.c[1]);
return val.i; return val.i;
}; }
public: public:
other_endian(const INT i = 0) other_endian(const INT i = 0)
{ {
......
...@@ -29,14 +29,14 @@ void bar1 () ...@@ -29,14 +29,14 @@ void bar1 ()
struct B struct B
{ {
void mwibble () void mwibble ()
{}; {}
void mwobble () void mwobble ()
{}; // { dg-bogus "" } cannot inline {} // { dg-bogus "" } cannot inline
static void swibble () static void swibble ()
{}; {}
static void swobble () static void swobble ()
{}; // { dg-bogus "" } cannot inline {} // { dg-bogus "" } cannot inline
}; };
void bar (void (B::*)()); void bar (void (B::*)());
...@@ -60,7 +60,7 @@ void bar3 (B *b) ...@@ -60,7 +60,7 @@ void bar3 (B *b)
struct C struct C
{ {
virtual void vwobble () virtual void vwobble ()
{}; // { dg-bogus "" } cannot inline {} // { dg-bogus "" } cannot inline
}; };
void bar4 () void bar4 ()
......
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