* 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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@123132
138bc75d-0d04-0410-961f-
82ee72b054a4
+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
struct c3 : virtual c1
{
- virtual c1* f6() {};
+ virtual c1* f6() {}
int i;
};
struct c7 : c3
{
- virtual c3* f6() {};
+ virtual c3* f6() {}
};
struct c24 : virtual c7
// 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()
{
class Foobar : public foo {
public:
- Foobar() { a = 1; b = 2; };
- virtual ~Foobar() {};
+ Foobar() { a = 1; b = 2; }
+ virtual ~Foobar() {}
};
Foobar obj;
struct Z : public X
{
- void a(void) {};
+ void a(void) {}
};
// 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 {}
};
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 {
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 ()
public:
- Ptr(void) : ptr(0) { };
- Ptr(T * p) : ptr(p) { };
+ Ptr(void) : ptr(0) { }
+ Ptr(T * p) : ptr(p) { }
~Ptr(void) { delete ptr; }
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)
struct T
{
static void (*handler)();
- static void func() {};
+ static void func() {}
};
bool fail;
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;
{
Base::Baz (); // { dg-error "is not a member" "" }
- };
+ }
};
{
typedef A Parent;
- B () : Parent () {};
+ B () : Parent () {}
};
class T
};
struct bar {
int z;
- bar () { foo::x[z]; };
+ bar () { foo::x[z]; }
};
{
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();
};
{
public:
enum InternalEnum { VALUE = 0 };
- BadStream( InternalEnum e ) {};
- BadStream( InternalEnum e, int i ) {};
+ BadStream( InternalEnum e ) {}
+ BadStream( InternalEnum e, int i ) {}
};
int main()
public:
virtual void DoSomething( void ) = 0;
protected:
- virtual ~JunkBase( void ) {};
+ virtual ~JunkBase( void ) {}
JunkBase( void ) {}
};
B x;
~C() {
A y;
- };
+ }
};
}
B<T> x;
~C() {
A<T> y;
- };
+ }
};
}
struct B {
void f(B);
- void g(B) {};
+ void g(B) {}
};
void f(B) {}
};
template <typename T> struct X<1,T> {
- X () { Y<T>::i; }; // access private field
+ X () { Y<T>::i; } // access private field
};
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; }
// 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(); }
};
{
foo(__PRETTY_FUNCTION__);
return B();
- };
+ }
};
B b=B().bar();
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)
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 {};
struct A1
{
- virtual void Foo () {};
+ virtual void Foo () {}
};
struct A : A1
class A {
char str[10];
public:
- char* m1 () { return str;};
+ char* m1 () { return str;}
};
class C : public A {
class ObjectExchange
{
public:
- ObjectExchange() {};
+ ObjectExchange() {}
ExchangeableList i_theWatchList; // Instruments being monitored
};
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 );
};
class DerivedClass : public BaseClass {
public:
- int virtMember() { return( 30 ); };
+ int virtMember() { return( 30 ); }
};
int operator != (const BaseClass irv, int x) { return irv.i != x; }
class B {
public:
B() {}
- B(const B &) { printf ("PASS\n"); exit (0); };
+ B(const B &) { printf ("PASS\n"); exit (0); }
private:
int x;
};
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" }
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); }
C &operator = (const C &x)
{
return *this;
- };
+ }
};
C &(C::*DD)(const C &x) = &C::operator=;
class test{
public:
int flags;
- test() {};
+ test() {}
};
int main()
public:
int & i;
- foo_int (int &j) : i(j) {};
+ foo_int (int &j) : i(j) {}
void inc () { i++; }
};
// 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);
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:
};
struct stackObj {
- ~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); };
+ ~stackObj() { ++d; printf ("stackObj::~stackObj()\n"); }
};
int test()
struct E {
int x;
- E(int i) { x = i; };
+ E(int i) { x = i; }
};
int main()
struct A
{
- A (){};
- virtual ~A () {};
+ A (){}
+ virtual ~A () {}
};
struct B : virtual A
{
class C {
public:
- virtual int foo (void) { return 0; };
+ virtual int foo (void) { return 0; }
};
}
protected:
char rep;
public:
- Char (const char ) {};
+ Char (const char ) {}
operator char() const;
void operator -= (const Char );
};
// PRMS Id: 5070 (testcase 1)
struct foo {
- foo(int x = 0) {};
+ foo(int x = 0) {}
int IsAlive(void) { return 1; }
};
class X { // { dg-error "assignment" }
int& a;
public:
- X(int& i): a(i) { };
+ X(int& i): a(i) { }
};
void foo ()
// 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 "" }
};
{
int val;
public:
- Fu(int i) : val(i) { };
+ Fu(int i) : val(i) { }
void print() { }
};
struct myStruct
{
- int action() {return 0;};
+ int action() {return 0;}
};
int main()
class Parent {
public:
- void DoSomething() { return; };
+ void DoSomething() { return; }
int i;
};
struct A {};
struct B {
- virtual void foo () {};
+ virtual void foo () {}
};
struct C : public B, public A {};
// PRMS id: 10912
struct A {
- A() { i=10; };
+ A() { i=10; }
int i;
};
struct B : public A {};
struct B
{
int f;
- B() : f(0) {};
- void g() { f = 0; };
+ B() : f(0) {}
+ void g() { f = 0; }
};
void f();
void f(int);
class DbmItem: public RefCount{
public:
- DbmItem(): RefCount() {};
+ DbmItem(): RefCount() {}
};
class A
{
public:
- void thiss() {};
+ void thiss() {}
};
class B
{
public:
- void that() {};
+ void that() {}
};
int main()
public:
enum muni {X, Y};
- muni e() { return X; };
+ muni e() { return X; }
muni f();
};
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()
boolean perform(method );
boolean perform(method , long);
void affectMethod(method );
- void dummy(){};
+ void dummy(){}
};
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; }
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)
class T2 {
friend void f (int& i) { // BOGUS -
i = 1;
- };
+ }
};
public:
virtual const T item() const = 0;
virtual const bool off() const = 0;
- virtual ~Traversable() { };
+ virtual ~Traversable() { }
};
class Chain : public Traversable {
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;
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;
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);
};
public:
B () {
!(A::j);
- };
+ }
};
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;
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
};
class l
{
public:
- void s() {};
+ void s() {}
};
extern t<l> g;
{
public:
void *h;
- s *a() {return (s *) h;};
+ s *a() {return (s *) h;}
};
{
{
struct A {
- A() {};
+ A() {}
} a;
};
{
struct A {
- A() {};
+ A() {}
} a ;
};
}
{
public:
double d;
- doubleclass(double x = 0) { d = x; };
+ doubleclass(double x = 0) { d = x; }
};
class test
//==========
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); }
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 {
//==========
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); }
class E : public C {
void f() {
printf( "%d\n", b);// { dg-error "" } .*
- };
+ }
};
struct b
{
- virtual void g() { };
+ virtual void g() { }
};
struct c: public a, public b
union AFX_PMSG {
public:
- AFX_PMSG () {};
+ AFX_PMSG () {}
AFX_PMSG ( BPROC bpr ) { bfn = bpr ; }
operator BPROC() { return bfn; }
class myFoundation {
protected:
- myFoundation () { count = 0; };
- virtual ~myFoundation () {};
+ myFoundation () { count = 0; }
+ virtual ~myFoundation () {}
public:
void addRef () { ++count; }
class firstIntermediate :virtual public myFoundation {
public:
- firstIntermediate () {};
- ~firstIntermediate () {};
+ firstIntermediate () {}
+ ~firstIntermediate () {}
void bar () { printf ("Bar\n"); }
};
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 () {
class A
{
public:
- virtual ~A(){};
+ virtual ~A(){}
virtual int type(void)
{
return -1;
class B
{
public:
- virtual ~B(){};
+ virtual ~B(){}
};
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>
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; }
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
List_DL<vertex<T> *> fanout;
vertex(): item(), fanout() // { dg-bogus "" }
- { };
+ { }
vertex(const T& i): item(), fanout() // { dg-bogus "" }
- { };
+ { }
};
template<class T>
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 ()
class A {
public:
- virtual void dummy (){};
+ virtual void dummy (){}
};
class B {
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 { };
class ParentOne {
public:
- ParentOne() {};
+ ParentOne() {}
#ifdef MAKE_WORK
- virtual ~ParentOne() {};
+ virtual ~ParentOne() {}
#endif
private:
char SomeData[101];
class ParentTwo {
public:
- ParentTwo() {};
- virtual ~ParentTwo() {};
+ ParentTwo() {}
+ virtual ~ParentTwo() {}
private:
int MoreData[12];
virtual int foo() { return 0; }
{
struct B
{
- virtual void b1() { };
+ virtual void b1() { }
};
return 0;
class Base {
int i;
public:
- Base() { i = 42; };
+ Base() { i = 42; }
};
class Derived : public Base, public Mixin {
public:
- Derived() { };
- Derived & operator=(Mixin & m) { return *this; };
+ Derived() { }
+ Derived & operator=(Mixin & m) { return *this; }
};
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) {
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() {
class B {
public:
int Bi;
- virtual int g() { return 0; };
+ virtual int g() { return 0; }
};
class D : private B {
++i;
if (i == 3)
throw 3;
- };
+ }
S () {}
struct S {
S () {
++i;
- };
+ }
S (int) {
- };
+ }
};
int main()
struct foo : filler3, virtual baz, filler4
{
static void a();
- void b() {};
+ void b() {}
int m;
};
struct T {
void g (S) {
- };
+ }
};
struct U {
// 2. crosscast
-struct J {virtual ~J(){};};
+struct J {virtual ~J(){}};
struct K : CC, private J {};
class KK : J, CC{};
// 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 {};
class foo {
public:
- foo() {};
+ foo() {}
void throwMe () {
throw *this; // { dg-error "" } cannot be used in throw-expression
- };
+ }
virtual void test () = 0;
};
class Foo2
{
public:
- Foo2() {};
- ~Foo2() { if (++cnt == 2) _exit (0); };
+ Foo2() {}
+ ~Foo2() { if (++cnt == 2) _exit (0); }
};
static Foo2& GetFoo2()
{
public:
Foo1() {}
- ~Foo1() { if (++cnt != 1) abort(); GetFoo2(); };
+ ~Foo1() { if (++cnt != 1) abort(); GetFoo2(); }
};
int main( int argc, const char* argv[] )
p = new T[size];
int foo;
foo = 5 * size;
- };
+ }
};
struct B
// { dg-do run }
-struct T { ~T() {}; };
+struct T { ~T() {} };
int g ()
{
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()
class A {
protected:
- static void f() {};
+ static void f() {}
};
class B : A {
};
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>) { }
void g() {
C e;
e.c = 3;
- };
+ }
};
S s;
// Origin: Leon Bottou <leonb@research.att.com>
class AA { protected:
- 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 BB { T x; BB(const T &x) : x(x) { } };
+ template <class T> struct CC : public BB<T> { CC(const T &x) : BB<T>(x) { }
};
};
struct A
{
public:
- ~A() { };
+ ~A() { }
class B;
};
} val;
val.i = x;
return val.c;
- };
+ }
public:
b() {
class PK_SignatureSystem
{
public:
- virtual ~PK_SignatureSystem() {};
+ virtual ~PK_SignatureSystem() {}
};
class PK_Signer : public virtual PK_SignatureSystem
{
template<class T, typename A<T>::F f>
struct B {
-static int g() { return f(); };
+static int g() { return f(); }
};
int f() { return 0; }
};
template <int N> struct B {
- B () { };
- B (const A<N> &) { };
+ B () { }
+ B (const A<N> &) { }
B (const A<N-1> &, int);
};
struct A
{
- void f(){};
+ void f(){}
A(){ ++r; }
~A(){ r -= 2; _exit (r); }
};
class Base {
public:
- class Bar { public: virtual ~Bar() {}; };
+ class Bar { public: virtual ~Bar() {} };
};
class Derived : public Base {
#include <stdarg.h>
struct A {
- virtual ~A () {};
+ virtual ~A () {}
};
template <class Type>
} val;
val.i = x;
return val.c;
- };
+ }
public:
b() {
// friend int f();
static int x;
public:
- static int f() {return foo::f();};
+ static int f() {return foo::f();}
};
};
// { dg-do assemble }
class Base {
public:
- class Bar { public: virtual ~Bar() {}; };
+ class Bar { public: virtual ~Bar() {} };
};
class Derived : public Base {
template <class T> class Expr
{
public :
- Expr(){};
- Expr(const T&){};
+ Expr(){}
+ Expr(const T&){}
};
template <class T >
class A1 {
friend class B;
public:
- virtual void foo() {};
+ virtual void foo() {}
};
class A2 : public virtual A1 {friend class B;};
class B
{
public:
- B(A1* a) : itsA(dynamic_cast<A2*>(a)) {};
+ B(A1* a) : itsA(dynamic_cast<A2*>(a)) {}
A2* itsA;
};
val.i = x;
std::swap(val.c[0], val.c[1]);
return val.i;
- };
+ }
_eb91_int16_t change_endian(_eb91_int16_t x)
{
val.i = x;
std::swap(val.c[0], val.c[1]);
return val.i;
- };
+ }
public:
other_endian(const INT i = 0)
{
struct B
{
void mwibble ()
- {};
+ {}
void mwobble ()
- {}; // { dg-bogus "" } cannot inline
+ {} // { dg-bogus "" } cannot inline
static void swibble ()
- {};
+ {}
static void swobble ()
- {}; // { dg-bogus "" } cannot inline
+ {} // { dg-bogus "" } cannot inline
};
void bar (void (B::*)());
struct C
{
virtual void vwobble ()
- {}; // { dg-bogus "" } cannot inline
+ {} // { dg-bogus "" } cannot inline
};
void bar4 ()