Commit 44957663 by Jason Merrill

fix implicit int

From-SVN: r23760
parent ff0cf464
...@@ -19,7 +19,7 @@ void blah (const T &) { ...@@ -19,7 +19,7 @@ void blah (const T &) {
x (4); x (4);
}; };
main () { int main () {
const foo<int> v; const foo<int> v;
blah (v); blah (v);
} }
......
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
char* m1 () { C::m1(); return ""; } // ERROR - char* m1 () { C::m1(); return ""; } // ERROR -
}; };
main () { int main () {
A a; A a;
B b; B b;
C c; C c;
......
int
main() { main() {
struct s struct s
{ {
......
...@@ -36,6 +36,7 @@ void C::f() { ...@@ -36,6 +36,7 @@ void C::f() {
} }
B b(3); B b(3);
int
main() { main() {
A *z = &b; // ERROR - A *z = &b; // ERROR -
} }
...@@ -43,6 +43,7 @@ public: ...@@ -43,6 +43,7 @@ public:
ExchangeableList i_theWatchList; // Instruments being monitored ExchangeableList i_theWatchList; // Instruments being monitored
}; };
int
main() main()
{ {
} }
...@@ -14,6 +14,7 @@ class B { ...@@ -14,6 +14,7 @@ class B {
A w; A w;
}; };
int
main() { main() {
B<int> c; B<int> c;
return c.f(); return c.f();
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
// GROUPS passed ARM-compliance // GROUPS passed ARM-compliance
// ARM $5.7, it's illegal to do math on a `void*'. // ARM $5.7, it's illegal to do math on a `void*'.
int
main() main()
{ {
void *p; void *p;
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
int i:8; int i:8;
} s; } s;
main() int main()
{ {
int &ir = s.i; // ERROR - address of bitfield int &ir = s.i; // ERROR - address of bitfield
int *ip = &s.i; // ERROR - address of bitfield int *ip = &s.i; // ERROR - address of bitfield
......
// Build don't link: // Build don't link:
// GROUPS passed boolean // GROUPS passed boolean
int
main() main()
{ {
typedef char Boolean; // Instrinsic.h typedef char Boolean; // Instrinsic.h
......
...@@ -8,7 +8,7 @@ public: ...@@ -8,7 +8,7 @@ public:
operator int () { return 0; } operator int () { return 0; }
}; };
int
main () main ()
{ {
C c1 (1); C c1 (1);
......
...@@ -64,7 +64,7 @@ void foo(Compound a) ...@@ -64,7 +64,7 @@ void foo(Compound a)
die (5); die (5);
} }
int
main() main()
{ {
Compound a; Compound a;
......
...@@ -48,6 +48,7 @@ public: ...@@ -48,6 +48,7 @@ public:
void Foo(B b) { b.Bar(); } void Foo(B b) { b.Bar(); }
int
main() main()
{ {
B b; B b;
......
...@@ -58,6 +58,7 @@ public: ...@@ -58,6 +58,7 @@ public:
int operator != (const BaseClass irv, int x) { return irv.i != x; } int operator != (const BaseClass irv, int x) { return irv.i != x; }
int
main () main ()
{ {
DerivedClass a; DerivedClass a;
......
...@@ -19,6 +19,7 @@ public: ...@@ -19,6 +19,7 @@ public:
A(const B &) { printf ("FAIL\n"); exit (1); } A(const B &) { printf ("FAIL\n"); exit (1); }
}; };
int
main() main()
{ {
A a; A a;
......
...@@ -27,6 +27,7 @@ public: ...@@ -27,6 +27,7 @@ public:
ParseToken () { tok = 0; intval = 0;} ParseToken () { tok = 0; intval = 0;}
}; };
int
main () { main () {
ParseToken a; ParseToken a;
a.tok = T_Float; a.tok = T_Float;
......
...@@ -18,6 +18,7 @@ class B : public A { ...@@ -18,6 +18,7 @@ class B : public A {
friend virtual void f2() { printf("i=%d j=%d\n",i,j); }// ERROR - virtual.*// ERROR - member.*// ERROR - member.* friend virtual void f2() { printf("i=%d j=%d\n",i,j); }// ERROR - virtual.*// ERROR - member.*// ERROR - member.*
}; };
int
main() { main() {
A * a = new A; A * a = new A;
} }
...@@ -32,4 +32,5 @@ gen_op Spul_U_axis() ...@@ -32,4 +32,5 @@ gen_op Spul_U_axis()
U1 = Fe(); U1 = Fe();
}; // ERROR - reaches end of non-void function }; // ERROR - reaches end of non-void function
int
main () {}; main () {};
...@@ -11,6 +11,7 @@ public: ...@@ -11,6 +11,7 @@ public:
int get_i() {return i;} int get_i() {return i;}
}; };
int
main() main()
{ {
cl ob[3] = {1, 2, 3}; cl ob[3] = {1, 2, 3};
......
...@@ -12,6 +12,7 @@ class B : public A { ...@@ -12,6 +12,7 @@ class B : public A {
virtual ~B() {cout << "executed ~B()\n";}; virtual ~B() {cout << "executed ~B()\n";};
}; };
int
main() { main() {
cout << "starting\n"; cout << "starting\n";
B b; B b;
......
// Special g++ Options: // Special g++ Options:
// Build don't link: // Build don't link:
// GROUPS passed old-abort // GROUPS passed old-abort
typedef unsigned long _G_clock_t; typedef unsigned long _G_clock_t;
...@@ -1394,7 +1394,7 @@ class queue : public object { ...@@ -1394,7 +1394,7 @@ class queue : public object {
DESTROYER destroy_f; DESTROYER destroy_f;
STRINGER string_f; STRINGER string_f;
int count; int count;
swap() int swap()
{ {
QUEUE tmp = Q; QUEUE tmp = Q;
Q = Q2; Q = Q2;
......
...@@ -11,6 +11,7 @@ struct GlobalAddress ...@@ -11,6 +11,7 @@ struct GlobalAddress
GlobalAddress(Value *nvar){}// ERROR - .* GlobalAddress(Value *nvar){}// ERROR - .*
};// ERROR - candidates .* };// ERROR - candidates .*
int
main() main()
{ {
new GlobalAddress(Value()); // internal error occured here// ERROR - no matching function .* new GlobalAddress(Value()); // internal error occured here// ERROR - no matching function .*
......
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
// GROUPS passed old-abort // GROUPS passed old-abort
#include <string> #include <string>
int
main(void) { main(void) {
string a[] = {"Hello"}; string a[] = {"Hello"};
......
// Build don't link: // Build don't link:
// GROUPS passed old-abort // GROUPS passed old-abort
extern void foo(void *); extern void foo(void *);
int
main() { main() {
foo((struct bar *)0); foo((struct bar *)0);
} }
...@@ -31,6 +31,7 @@ template< class T, int n> class Implicit : public T { ...@@ -31,6 +31,7 @@ template< class T, int n> class Implicit : public T {
BASE operator=(BASE t) { return T::operator=(t); } BASE operator=(BASE t) { return T::operator=(t); }
}; };
int
main() main()
{ {
Implicit<Implicit<INTEGER, 2> , 3> y; Implicit<Implicit<INTEGER, 2> , 3> y;
......
...@@ -18,6 +18,7 @@ template <class T> void bug<T>::Foo(const int) ...@@ -18,6 +18,7 @@ template <class T> void bug<T>::Foo(const int)
{ {
} }
int
main() main()
{ {
bug<char> InstantiatedBug; bug<char> InstantiatedBug;
......
...@@ -85,6 +85,7 @@ public: ...@@ -85,6 +85,7 @@ public:
int i; int i;
}; };
int
main() main()
{ {
Ref<XRep> y; Ref<XRep> y;
......
...@@ -15,6 +15,7 @@ bug::bug(int size) ...@@ -15,6 +15,7 @@ bug::bug(int size)
numbers = new internal(size * size);// ERROR - no match.* numbers = new internal(size * size);// ERROR - no match.*
} }
int
main() main()
{ {
bug test;// ERROR - no match bug test;// ERROR - no match
......
...@@ -96,6 +96,7 @@ class Dummy ...@@ -96,6 +96,7 @@ class Dummy
Dummy() {} Dummy() {}
}; };
int
main() main()
{ {
SimpleSet<Dummy *> bs1; SimpleSet<Dummy *> bs1;
......
...@@ -22,7 +22,7 @@ public: ...@@ -22,7 +22,7 @@ public:
C &(C::*DD)(const C &x) = &C::operator=; C &(C::*DD)(const C &x) = &C::operator=;
main() int main()
{ {
&DD; &DD;
......
// Build don't link: // Build don't link:
// GROUPS passed old-abort // GROUPS passed old-abort
main() int main()
{ {
int a[100], **p; int a[100], **p;
......
...@@ -7,7 +7,7 @@ public: ...@@ -7,7 +7,7 @@ public:
foo(); foo();
}; };
main() int main()
{ {
static foo& a = *(new foo); static foo& a = *(new foo);
} }
// Build don't link: // Build don't link:
// GROUPS passed templates // GROUPS passed templates
template<class T> template<class T>
class Vector class Vector
{ {
...@@ -16,7 +17,7 @@ template<class T>// ERROR - previous definition of T ...@@ -16,7 +17,7 @@ template<class T>// ERROR - previous definition of T
struct Comparator struct Comparator
{ {
typedef T T;// ERROR - use of template type T in typedef to T typedef T T;// ERROR - use of template type T in typedef to T
static lessthan (T &a, T &b) { return a < b; } static int lessthan (T &a, T &b) { return a < b; }
}; };
template<class Comp> template<class Comp>
......
...@@ -7,7 +7,7 @@ public: ...@@ -7,7 +7,7 @@ public:
class derv : public foo { }; class derv : public foo { };
main() int main()
{ {
foo::bar x = foo::baz; foo::bar x = foo::baz;
derv::bar y = derv::bat; derv::bar y = derv::bat;
......
...@@ -12,7 +12,7 @@ public: ...@@ -12,7 +12,7 @@ public:
class derv : public foo, public foo2 { }; class derv : public foo, public foo2 { };
main() int main()
{ {
foo::bar x = foo::baz; foo::bar x = foo::baz;
derv::bar2 y = derv::bat2; derv::bar2 y = derv::bat2;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// GROUPS passed enums // GROUPS passed enums
enum Thing { FIRST, SECOND } ; enum Thing { FIRST, SECOND } ;
main() int main()
{ {
Thing x = FIRST ; Thing x = FIRST ;
x = 27 ; // this line should be a type error.// ERROR - .* x = 27 ; // this line should be a type error.// ERROR - .*
......
...@@ -16,4 +16,4 @@ public: ...@@ -16,4 +16,4 @@ public:
B b; B b;
main () {} int main () {}
...@@ -20,7 +20,7 @@ public: ...@@ -20,7 +20,7 @@ public:
void *lookup(const char *) {} void *lookup(const char *) {}
}; };
main() int main()
{ {
char buf[2048]; char buf[2048];
dictionary exceptions; dictionary exceptions;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// GROUPS passed array-bindings // GROUPS passed array-bindings
char * bob(); char * bob();
main() int main()
{ {
char a[1][2]; char a[1][2];
a[0] = bob();// ERROR - .* a[0] = bob();// ERROR - .*
......
...@@ -31,7 +31,7 @@ public: ...@@ -31,7 +31,7 @@ public:
// bar1 should get built before bar2 // bar1 should get built before bar2
foo::foo (int x, int y) : b(x), a(y) {} foo::foo (int x, int y) : b(x), a(y) {}
main() int main()
{ {
foo f (1, 2); foo f (1, 2);
printf ("PASS\n"); printf ("PASS\n");
......
...@@ -9,4 +9,4 @@ public: ...@@ -9,4 +9,4 @@ public:
static int New(int);// ERROR - declaration.* static int New(int);// ERROR - declaration.*
}; };
main() {} int main() {}
// GROUPS passed miscellaneous // GROUPS passed miscellaneous
extern "C" void printf (char *, ...); extern "C" void printf (char *, ...);
main() int main()
{ {
int i = 0; int i = 0;
// Make sure build_unary_op correctly computes this. // Make sure build_unary_op correctly computes this.
......
...@@ -12,7 +12,7 @@ foo::foo(int a) ...@@ -12,7 +12,7 @@ foo::foo(int a)
foo::a=a; foo::a=a;
} }
main() int main()
{ {
foo obj(4); foo obj(4);
} }
...@@ -25,6 +25,6 @@ void A::B::g (int val) ...@@ -25,6 +25,6 @@ void A::B::g (int val)
} }
main () int main ()
{ {
} }
...@@ -71,7 +71,7 @@ Dump2::operator<<(double r) ...@@ -71,7 +71,7 @@ Dump2::operator<<(double r)
strcpy (output, tempout); strcpy (output, tempout);
return *this; } return *this; }
main() int main()
{ {
BDDRetrace::Dump1 d1; BDDRetrace::Dump1 d1;
Dump2 d2; Dump2 d2;
......
...@@ -9,4 +9,4 @@ public: ...@@ -9,4 +9,4 @@ public:
X::M2 X::g(int i) { X::M2 m2; return m2; } X::M2 X::g(int i) { X::M2 m2; return m2; }
main() { } int main() { }
...@@ -13,6 +13,6 @@ void MakeBug() { ...@@ -13,6 +13,6 @@ void MakeBug() {
job = new AStruct; job = new AStruct;
} }
main () { int main () {
MakeBug(); MakeBug();
} }
...@@ -8,7 +8,7 @@ int operator()(A x,float y) { // MUST be a member function// ERROR - .* ...@@ -8,7 +8,7 @@ int operator()(A x,float y) { // MUST be a member function// ERROR - .*
return 1; return 1;
} }
main() { int main() {
A x; A x;
x(1.0); // ERROR - no match for call x(1.0); // ERROR - no match for call
} }
...@@ -12,7 +12,7 @@ public: ...@@ -12,7 +12,7 @@ public:
int f (int); // ERROR - candidates are int f (int); // ERROR - candidates are
}; };
main () int main ()
{ {
Bar b; Bar b;
......
...@@ -24,7 +24,7 @@ class Casted { ...@@ -24,7 +24,7 @@ class Casted {
operator double() const { return y; } operator double() const { return y; }
}; };
main() int main()
{ {
Casted c(10,12.34); Casted c(10,12.34);
......
...@@ -4,6 +4,6 @@ typedef struct{double re,im;} complex; ...@@ -4,6 +4,6 @@ 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;}
main(){complex c; Complex C; int main(){complex c; Complex C;
zxcvbnm(1,c); zxcvbnm(1,c);
zxcvbnm(1,C);} zxcvbnm(1,C);}
...@@ -11,7 +11,7 @@ class CGLogger : public CLogger ...@@ -11,7 +11,7 @@ class CGLogger : public CLogger
{ {
} GLog; } GLog;
main() int main()
{ {
Log(1,"Test");// ERROR - call of.* Log(1,"Test");// ERROR - call of.*
Log(1,"Test %d",3); Log(1,"Test %d",3);
......
...@@ -9,7 +9,7 @@ public: ...@@ -9,7 +9,7 @@ public:
void mf() { s='\"'; } void mf() { s='\"'; }
}; };
main() int main()
{ {
Try x; Try x;
x.mf(); x.mf();
......
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
int g() { return 0; } // gets bogus error - referenced below XFAIL *-*-* int g() { return 0; } // gets bogus error - referenced below XFAIL *-*-*
main() int main()
{ {
int try1; int try1;
B( try1 ).f(); // no syntax error B( try1 ).f(); // no syntax error
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
class A { }; class A { };
main() { int main() {
A a = a; A a = a;
A b(b); // gets bogus error - XFAIL *-*-* A b(b); // gets bogus error - XFAIL *-*-*
} }
...@@ -5,7 +5,7 @@ public: ...@@ -5,7 +5,7 @@ public:
operator ++ (); // ERROR - no type or storage class operator ++ (); // ERROR - no type or storage class
}; };
main() int main()
{ {
foo x; foo x;
......
...@@ -62,7 +62,7 @@ int PTcl::three(int, char** argv) { ...@@ -62,7 +62,7 @@ int PTcl::three(int, char** argv) {
return 0; return 0;
} }
main (int argc, char** argv) { int main (int argc, char** argv) {
PTcl obj; PTcl obj;
obj.dispatcher(1,argc,argv); obj.dispatcher(1,argc,argv);
return 0; return 0;
......
...@@ -71,7 +71,7 @@ public: ...@@ -71,7 +71,7 @@ public:
friend class DataBase; friend class DataBase;
}; };
main() int main()
{ {
DBpathrec a(), b(); DBpathrec a(), b();
......
...@@ -21,7 +21,7 @@ B GLOBAL_B; ...@@ -21,7 +21,7 @@ B GLOBAL_B;
B& foo() {return GLOBAL_B;} B& foo() {return GLOBAL_B;}
main() int main()
{ {
// build_scoped_method_call and build_scoped_ref should know how // build_scoped_method_call and build_scoped_ref should know how
// to deal with a reference for this // to deal with a reference for this
......
...@@ -13,7 +13,7 @@ class A ...@@ -13,7 +13,7 @@ class A
} }
}; };
main() int main()
{ {
A::staticMember(); A::staticMember();
} }
...@@ -37,7 +37,7 @@ struct myStruct ...@@ -37,7 +37,7 @@ struct myStruct
int action() {return 24;}; int action() {return 24;};
}; };
main() int main()
{ {
myStruct toto; myStruct toto;
......
...@@ -9,6 +9,6 @@ public: ...@@ -9,6 +9,6 @@ public:
template <class Q> template <class Q>
int Conc<Q>::body() {return 0;} int Conc<Q>::body() {return 0;}
main () { int main () {
Conc<int> s2; Conc<int> s2;
} }
...@@ -15,7 +15,7 @@ public : ...@@ -15,7 +15,7 @@ public :
int find(); int find();
}; };
main() int main()
{ {
int z = Foo::bar.find(); int z = Foo::bar.find();
} }
...@@ -14,7 +14,7 @@ func (int const& i) ...@@ -14,7 +14,7 @@ func (int const& i)
{} {}
main () int main ()
{ {
Foo<int const> foo; Foo<int const> foo;
printf ("PASS\n"); printf ("PASS\n");
......
...@@ -11,7 +11,7 @@ public: ...@@ -11,7 +11,7 @@ public:
int func (int h = 1, int z = 2) { return h+z; } int func (int h = 1, int z = 2) { return h+z; }
main () int main ()
{ {
Temp<int(*)(int, int)> temp (func); Temp<int(*)(int, int)> temp (func);
......
...@@ -7,7 +7,7 @@ public: ...@@ -7,7 +7,7 @@ public:
operator const char*() { return fptr; } operator const char*() { return fptr; }
}; };
main(){ int main(){
X x1("1234"); X x1("1234");
X x2(x1+1); X x2(x1+1);
} }
...@@ -9,4 +9,4 @@ ...@@ -9,4 +9,4 @@
template <class ElementType> ElementType A<ElementType>::get() const template <class ElementType> ElementType A<ElementType>::get() const
{ return ElementType(0); } { return ElementType(0); }
main() { const A<short> a(3); } int main() { const A<short> a(3); }
...@@ -10,7 +10,7 @@ union Double_alignt{ ...@@ -10,7 +10,7 @@ union Double_alignt{
}; };
main(){ int main(){
Double_alignt<20000> heap; Double_alignt<20000> heap;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// GROUPS passed temporaries // GROUPS passed temporaries
#include <stdio.h> #include <stdio.h>
main () int main ()
{ {
int a = 2; int a = 2;
......
...@@ -5,7 +5,7 @@ int bar () ...@@ -5,7 +5,7 @@ int bar ()
throw 100; throw 100;
} }
main () int main ()
{ {
int i = 0; // this gets deleted after flow analysis int i = 0; // this gets deleted after flow analysis
try try
......
...@@ -17,7 +17,7 @@ void foo (B*); ...@@ -17,7 +17,7 @@ void foo (B*);
int newed, created; int newed, created;
main () int main ()
{ {
try { try {
foo (new B (A ())); foo (new B (A ()));
......
...@@ -17,7 +17,7 @@ void foo (B*); ...@@ -17,7 +17,7 @@ void foo (B*);
int newed, created; int newed, created;
main () int main ()
{ {
try { try {
foo (new B (A ())); foo (new B (A ()));
......
...@@ -12,7 +12,7 @@ struct A { ...@@ -12,7 +12,7 @@ struct A {
void * operator new (size_t size, int, int) { return operator new (size); } void * operator new (size_t size, int, int) { return operator new (size); }
main () int main ()
{ {
try { try {
A* ap = new (1, 5) A; A* ap = new (1, 5) A;
......
...@@ -12,7 +12,7 @@ struct A { ...@@ -12,7 +12,7 @@ struct A {
void * operator new (size_t size, int, int) { return operator new (size); } void * operator new (size_t size, int, int) { return operator new (size); }
main () int main ()
{ {
try { try {
A* ap = new (1, 5) A; A* ap = new (1, 5) A;
......
...@@ -31,7 +31,7 @@ eh_test (int level) ...@@ -31,7 +31,7 @@ eh_test (int level)
} }
} }
main () int main ()
{ {
std::set_terminate (&eh_terminate); std::set_terminate (&eh_terminate);
eh_test (0); eh_test (0);
......
...@@ -13,7 +13,7 @@ f () throw (char, int, std::bad_exception) ...@@ -13,7 +13,7 @@ f () throw (char, int, std::bad_exception)
throw 'a'; throw 'a';
} }
main () int main ()
{ {
std::set_terminate (my_term); std::set_terminate (my_term);
std::set_unexpected (my_unexp); std::set_unexpected (my_unexp);
......
...@@ -13,7 +13,7 @@ f () throw (int, std::bad_exception) ...@@ -13,7 +13,7 @@ f () throw (int, std::bad_exception)
throw 'a'; throw 'a';
} }
main () int main ()
{ {
std::set_terminate (my_term); std::set_terminate (my_term);
std::set_unexpected (my_unexp); std::set_unexpected (my_unexp);
......
...@@ -13,7 +13,7 @@ f () throw (std::bad_exception) ...@@ -13,7 +13,7 @@ f () throw (std::bad_exception)
throw 'a'; throw 'a';
} }
main () int main ()
{ {
std::set_terminate (my_term); std::set_terminate (my_term);
std::set_unexpected (my_unexp); std::set_unexpected (my_unexp);
......
...@@ -13,7 +13,7 @@ f () throw (short) ...@@ -13,7 +13,7 @@ f () throw (short)
throw 'a'; throw 'a';
} }
main () int main ()
{ {
std::set_terminate (my_term); std::set_terminate (my_term);
std::set_unexpected (my_unexp); std::set_unexpected (my_unexp);
......
...@@ -11,7 +11,7 @@ public: ...@@ -11,7 +11,7 @@ public:
A*(*A::ptr)(int) = &A::func; A*(*A::ptr)(int) = &A::func;
main() int main()
{ {
A foo; A foo;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
void f (int *) { } void f (int *) { }
void f (char, char); void f (char, char);
main () int main ()
{ {
f (__null); f (__null);
} }
...@@ -502,7 +502,7 @@ operator<<(ostream& o, const SLS& s) ...@@ -502,7 +502,7 @@ operator<<(ostream& o, const SLS& s)
SLS gsls; SLS gsls;
const SLS gcsls; const SLS gcsls;
foo() int foo()
{ {
const unsigned SIZE = 20; const unsigned SIZE = 20;
...@@ -563,7 +563,7 @@ foo() ...@@ -563,7 +563,7 @@ foo()
} }
// Dummy function so it'll run // Dummy function so it'll run
main() int main()
{ {
cout << "PASS" << endl; cout << "PASS" << endl;
} }
......
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
void bar() { b::foo(); } // gets bogus error void bar() { b::foo(); } // gets bogus error
}; };
main() { int main() {
c test; c test;
test.bar(); test.bar();
} }
...@@ -14,7 +14,7 @@ struct B : public A ...@@ -14,7 +14,7 @@ struct B : public A
void func() { foo(); } // ERROR - void func() { foo(); } // ERROR -
}; };
main() int main()
{ {
B b; B b;
b.func(); b.func();
......
...@@ -38,7 +38,7 @@ private: ...@@ -38,7 +38,7 @@ private:
struct Bar : public Foo { struct Bar : public Foo {
public: public:
DoSomething() { void DoSomething() {
PUB_A = 0; PUB_A = 0;
Foo::A = 0; Foo::A = 0;
printf("%x\n",pX); printf("%x\n",pX);
...@@ -57,7 +57,7 @@ public: ...@@ -57,7 +57,7 @@ public:
} }
}; };
main() int main()
{ {
Foo a; Foo a;
......
struct A { int i; }; struct A { int i; };
main() int main()
{ {
A a1 = { 42 }; A a1 = { 42 };
A a2 (a1); A a2 (a1);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
struct T { ~T(); }; struct T { ~T(); };
main() int main()
{ {
foo: foo:
T t; // ERROR - redeclared T t; // ERROR - redeclared
......
...@@ -5,7 +5,7 @@ struct F { ...@@ -5,7 +5,7 @@ struct F {
bool b2 : 7; bool b2 : 7;
}; };
main() int main()
{ {
F f = { true, true }; F f = { true, true };
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
struct A { }; struct A { };
main () int main ()
{ {
bool b = (void*)0; bool b = (void*)0;
b = (int A::*)0; b = (int A::*)0;
......
main () int main ()
{ {
bool b = false; bool b = false;
int i = b++; int i = b++;
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
bool b; bool b;
main () int main ()
{ {
return ((!b) != 0); return ((!b) != 0);
} }
...@@ -12,7 +12,7 @@ struct A { ...@@ -12,7 +12,7 @@ struct A {
void foo (A a) void foo (A a)
{ } { }
main() int main()
{ {
foo (1); foo (1);
return count; return count;
......
...@@ -9,7 +9,7 @@ public: ...@@ -9,7 +9,7 @@ public:
Class varOfClass; Class varOfClass;
main() { int main() {
// This MUST be 'const' to generate the error... // This MUST be 'const' to generate the error...
const Class arrayOfClass[1] = { varOfClass }; // causes abort const Class arrayOfClass[1] = { varOfClass }; // causes abort
} }
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// GROUPS passed rtti // GROUPS passed rtti
// Negative testcase for decls in conditions. // Negative testcase for decls in conditions.
main() int main()
{ {
float i; float i;
......
...@@ -14,7 +14,7 @@ struct T ...@@ -14,7 +14,7 @@ struct T
operator int () { return i; } operator int () { return i; }
}; };
main () int main ()
{ {
int t; int t;
......
...@@ -11,4 +11,4 @@ struct T { ...@@ -11,4 +11,4 @@ struct T {
void T::f() { printf ("%p", &letter); } void T::f() { printf ("%p", &letter); }
const char T::letter; // still need def after class const char T::letter; // still need def after class
main() { } int main() { }
...@@ -4,7 +4,7 @@ extern int i; ...@@ -4,7 +4,7 @@ extern int i;
const int bar = i; const int bar = i;
int i = 5; int i = 5;
main() int main()
{ {
return bar != 5; return bar != 5;
} }
...@@ -30,7 +30,7 @@ typedef unsigned short Type; ...@@ -30,7 +30,7 @@ typedef unsigned short Type;
typedef Container<Type> TypeContainer; typedef Container<Type> TypeContainer;
main(void) int main(void)
{ {
TypeContainer myTypeContainer(2); TypeContainer myTypeContainer(2);
Type t = myTypeContainer; Type t = myTypeContainer;
......
// PRMS id: 8279 // PRMS id: 8279
main () int main ()
{ {
char *const *p = 0; char *const *p = 0;
char **q = 0; char **q = 0;
......
...@@ -2,7 +2,7 @@ struct A { ...@@ -2,7 +2,7 @@ struct A {
A(); A();
A(A); // ERROR - copy ctor must take reference A(A); // ERROR - copy ctor must take reference
}; };
main() int main()
{ {
A a; A a;
A b(a); // causes compiler segfault A b(a); // causes compiler segfault
......
...@@ -15,7 +15,7 @@ void f(void) ...@@ -15,7 +15,7 @@ void f(void)
r = 0; r = 0;
} }
main() int main()
{ {
struct xx p; struct xx p;
......
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