fix implicit int

From-SVN: r23760
This commit is contained in:
Jason Merrill 1998-11-22 18:23:45 -05:00
parent ff0cf464a4
commit 4495766362
405 changed files with 445 additions and 417 deletions

View File

@ -19,7 +19,7 @@ void blah (const T &) {
x (4);
};
main () {
int main () {
const foo<int> v;
blah (v);
}

View File

@ -14,7 +14,7 @@ public:
char* m1 () { C::m1(); return ""; } // ERROR -
};
main () {
int main () {
A a;
B b;
C c;

View File

@ -1,3 +1,4 @@
int
main() {
struct s
{

View File

@ -36,6 +36,7 @@ void C::f() {
}
B b(3);
int
main() {
A *z = &b; // ERROR -
}

View File

@ -43,6 +43,7 @@ public:
ExchangeableList i_theWatchList; // Instruments being monitored
};
int
main()
{
}

View File

@ -14,6 +14,7 @@ class B {
A w;
};
int
main() {
B<int> c;
return c.f();

View File

@ -3,6 +3,7 @@
// GROUPS passed ARM-compliance
// ARM $5.7, it's illegal to do math on a `void*'.
int
main()
{
void *p;

View File

@ -5,7 +5,7 @@
int i:8;
} s;
main()
int main()
{
int &ir = s.i; // ERROR - address of bitfield
int *ip = &s.i; // ERROR - address of bitfield

View File

@ -1,5 +1,6 @@
// Build don't link:
// GROUPS passed boolean
int
main()
{
typedef char Boolean; // Instrinsic.h

View File

@ -8,7 +8,7 @@ public:
operator int () { return 0; }
};
int
main ()
{
C c1 (1);

View File

@ -64,7 +64,7 @@ void foo(Compound a)
die (5);
}
int
main()
{
Compound a;

View File

@ -48,6 +48,7 @@ public:
void Foo(B b) { b.Bar(); }
int
main()
{
B b;

View File

@ -58,6 +58,7 @@ public:
int operator != (const BaseClass irv, int x) { return irv.i != x; }
int
main ()
{
DerivedClass a;

View File

@ -19,6 +19,7 @@ public:
A(const B &) { printf ("FAIL\n"); exit (1); }
};
int
main()
{
A a;

View File

@ -27,6 +27,7 @@ public:
ParseToken () { tok = 0; intval = 0;}
};
int
main () {
ParseToken a;
a.tok = T_Float;

View File

@ -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.*
};
int
main() {
A * a = new A;
}

View File

@ -32,4 +32,5 @@ gen_op Spul_U_axis()
U1 = Fe();
}; // ERROR - reaches end of non-void function
int
main () {};

View File

@ -11,6 +11,7 @@ public:
int get_i() {return i;}
};
int
main()
{
cl ob[3] = {1, 2, 3};

View File

@ -12,6 +12,7 @@ class B : public A {
virtual ~B() {cout << "executed ~B()\n";};
};
int
main() {
cout << "starting\n";
B b;

View File

@ -1,4 +1,4 @@
// Special g++ Options:
// Special g++ Options:
// Build don't link:
// GROUPS passed old-abort
typedef unsigned long _G_clock_t;
@ -1394,7 +1394,7 @@ class queue : public object {
DESTROYER destroy_f;
STRINGER string_f;
int count;
swap()
int swap()
{
QUEUE tmp = Q;
Q = Q2;

View File

@ -11,6 +11,7 @@ struct GlobalAddress
GlobalAddress(Value *nvar){}// ERROR - .*
};// ERROR - candidates .*
int
main()
{
new GlobalAddress(Value()); // internal error occured here// ERROR - no matching function .*

View File

@ -2,6 +2,7 @@
// GROUPS passed old-abort
#include <string>
int
main(void) {
string a[] = {"Hello"};

View File

@ -1,6 +1,7 @@
// Build don't link:
// GROUPS passed old-abort
extern void foo(void *);
int
main() {
foo((struct bar *)0);
}

View File

@ -31,6 +31,7 @@ template< class T, int n> class Implicit : public T {
BASE operator=(BASE t) { return T::operator=(t); }
};
int
main()
{
Implicit<Implicit<INTEGER, 2> , 3> y;

View File

@ -18,6 +18,7 @@ template <class T> void bug<T>::Foo(const int)
{
}
int
main()
{
bug<char> InstantiatedBug;

View File

@ -85,6 +85,7 @@ public:
int i;
};
int
main()
{
Ref<XRep> y;

View File

@ -15,6 +15,7 @@ bug::bug(int size)
numbers = new internal(size * size);// ERROR - no match.*
}
int
main()
{
bug test;// ERROR - no match

View File

@ -96,6 +96,7 @@ class Dummy
Dummy() {}
};
int
main()
{
SimpleSet<Dummy *> bs1;

View File

@ -22,7 +22,7 @@ public:
C &(C::*DD)(const C &x) = &C::operator=;
main()
int main()
{
&DD;

View File

@ -1,6 +1,6 @@
// Build don't link:
// GROUPS passed old-abort
main()
int main()
{
int a[100], **p;

View File

@ -7,7 +7,7 @@ public:
foo();
};
main()
int main()
{
static foo& a = *(new foo);
}

View File

@ -1,5 +1,6 @@
// Build don't link:
// GROUPS passed templates
template<class T>
class Vector
{
@ -16,7 +17,7 @@ template<class T>// ERROR - previous definition of T
struct Comparator
{
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>

View File

@ -7,7 +7,7 @@ public:
class derv : public foo { };
main()
int main()
{
foo::bar x = foo::baz;
derv::bar y = derv::bat;

View File

@ -12,7 +12,7 @@ public:
class derv : public foo, public foo2 { };
main()
int main()
{
foo::bar x = foo::baz;
derv::bar2 y = derv::bat2;

View File

@ -3,7 +3,7 @@
// GROUPS passed enums
enum Thing { FIRST, SECOND } ;
main()
int main()
{
Thing x = FIRST ;
x = 27 ; // this line should be a type error.// ERROR - .*

View File

@ -16,4 +16,4 @@ public:
B b;
main () {}
int main () {}

View File

@ -20,7 +20,7 @@ public:
void *lookup(const char *) {}
};
main()
int main()
{
char buf[2048];
dictionary exceptions;

View File

@ -2,7 +2,7 @@
// GROUPS passed array-bindings
char * bob();
main()
int main()
{
char a[1][2];
a[0] = bob();// ERROR - .*

View File

@ -31,7 +31,7 @@ public:
// bar1 should get built before bar2
foo::foo (int x, int y) : b(x), a(y) {}
main()
int main()
{
foo f (1, 2);
printf ("PASS\n");

View File

@ -9,4 +9,4 @@ public:
static int New(int);// ERROR - declaration.*
};
main() {}
int main() {}

View File

@ -1,7 +1,7 @@
// GROUPS passed miscellaneous
extern "C" void printf (char *, ...);
main()
int main()
{
int i = 0;
// Make sure build_unary_op correctly computes this.

View File

@ -12,7 +12,7 @@ foo::foo(int a)
foo::a=a;
}
main()
int main()
{
foo obj(4);
}

View File

@ -25,6 +25,6 @@ void A::B::g (int val)
}
main ()
int main ()
{
}

View File

@ -71,7 +71,7 @@ Dump2::operator<<(double r)
strcpy (output, tempout);
return *this; }
main()
int main()
{
BDDRetrace::Dump1 d1;
Dump2 d2;

View File

@ -9,4 +9,4 @@ public:
X::M2 X::g(int i) { X::M2 m2; return m2; }
main() { }
int main() { }

View File

@ -13,6 +13,6 @@ void MakeBug() {
job = new AStruct;
}
main () {
int main () {
MakeBug();
}

View File

@ -8,7 +8,7 @@ int operator()(A x,float y) { // MUST be a member function// ERROR - .*
return 1;
}
main() {
int main() {
A x;
x(1.0); // ERROR - no match for call
}

View File

@ -12,7 +12,7 @@ public:
int f (int); // ERROR - candidates are
};
main ()
int main ()
{
Bar b;

View File

@ -24,7 +24,7 @@ class Casted {
operator double() const { return y; }
};
main()
int main()
{
Casted c(10,12.34);

View File

@ -4,6 +4,6 @@ typedef struct{double re,im;} complex;
class Complex{public:double re,im;
inline void operator=(Complex&X){re=X.re; im=X.im;};};
void zxcvbnm(int n,...){n=1;}
main(){complex c; Complex C;
int main(){complex c; Complex C;
zxcvbnm(1,c);
zxcvbnm(1,C);}

View File

@ -11,7 +11,7 @@ class CGLogger : public CLogger
{
} GLog;
main()
int main()
{
Log(1,"Test");// ERROR - call of.*
Log(1,"Test %d",3);

View File

@ -9,7 +9,7 @@ public:
void mf() { s='\"'; }
};
main()
int main()
{
Try x;
x.mf();

View File

@ -14,7 +14,7 @@ public:
int g() { return 0; } // gets bogus error - referenced below XFAIL *-*-*
main()
int main()
{
int try1;
B( try1 ).f(); // no syntax error

View File

@ -7,7 +7,7 @@
class A { };
main() {
int main() {
A a = a;
A b(b); // gets bogus error - XFAIL *-*-*
}

View File

@ -5,7 +5,7 @@ public:
operator ++ (); // ERROR - no type or storage class
};
main()
int main()
{
foo x;

View File

@ -62,7 +62,7 @@ int PTcl::three(int, char** argv) {
return 0;
}
main (int argc, char** argv) {
int main (int argc, char** argv) {
PTcl obj;
obj.dispatcher(1,argc,argv);
return 0;

View File

@ -71,7 +71,7 @@ public:
friend class DataBase;
};
main()
int main()
{
DBpathrec a(), b();

View File

@ -21,7 +21,7 @@ B GLOBAL_B;
B& foo() {return GLOBAL_B;}
main()
int main()
{
// build_scoped_method_call and build_scoped_ref should know how
// to deal with a reference for this

View File

@ -13,7 +13,7 @@ class A
}
};
main()
int main()
{
A::staticMember();
}

View File

@ -37,7 +37,7 @@ struct myStruct
int action() {return 24;};
};
main()
int main()
{
myStruct toto;

View File

@ -9,6 +9,6 @@ public:
template <class Q>
int Conc<Q>::body() {return 0;}
main () {
int main () {
Conc<int> s2;
}

View File

@ -15,7 +15,7 @@ public :
int find();
};
main()
int main()
{
int z = Foo::bar.find();
}

View File

@ -14,7 +14,7 @@ func (int const& i)
{}
main ()
int main ()
{
Foo<int const> foo;
printf ("PASS\n");

View File

@ -11,7 +11,7 @@ public:
int func (int h = 1, int z = 2) { return h+z; }
main ()
int main ()
{
Temp<int(*)(int, int)> temp (func);

View File

@ -7,7 +7,7 @@ public:
operator const char*() { return fptr; }
};
main(){
int main(){
X x1("1234");
X x2(x1+1);
}

View File

@ -9,4 +9,4 @@
template <class ElementType> ElementType A<ElementType>::get() const
{ return ElementType(0); }
main() { const A<short> a(3); }
int main() { const A<short> a(3); }

View File

@ -10,7 +10,7 @@ union Double_alignt{
};
main(){
int main(){
Double_alignt<20000> heap;

View File

@ -2,7 +2,7 @@
// GROUPS passed temporaries
#include <stdio.h>
main ()
int main ()
{
int a = 2;

View File

@ -5,7 +5,7 @@ int bar ()
throw 100;
}
main ()
int main ()
{
int i = 0; // this gets deleted after flow analysis
try

View File

@ -17,7 +17,7 @@ void foo (B*);
int newed, created;
main ()
int main ()
{
try {
foo (new B (A ()));

View File

@ -17,7 +17,7 @@ void foo (B*);
int newed, created;
main ()
int main ()
{
try {
foo (new B (A ()));

View File

@ -12,7 +12,7 @@ struct A {
void * operator new (size_t size, int, int) { return operator new (size); }
main ()
int main ()
{
try {
A* ap = new (1, 5) A;

View File

@ -12,7 +12,7 @@ struct A {
void * operator new (size_t size, int, int) { return operator new (size); }
main ()
int main ()
{
try {
A* ap = new (1, 5) A;

View File

@ -31,7 +31,7 @@ eh_test (int level)
}
}
main ()
int main ()
{
std::set_terminate (&eh_terminate);
eh_test (0);

View File

@ -13,7 +13,7 @@ f () throw (char, int, std::bad_exception)
throw 'a';
}
main ()
int main ()
{
std::set_terminate (my_term);
std::set_unexpected (my_unexp);

View File

@ -13,7 +13,7 @@ f () throw (int, std::bad_exception)
throw 'a';
}
main ()
int main ()
{
std::set_terminate (my_term);
std::set_unexpected (my_unexp);

View File

@ -13,7 +13,7 @@ f () throw (std::bad_exception)
throw 'a';
}
main ()
int main ()
{
std::set_terminate (my_term);
std::set_unexpected (my_unexp);

View File

@ -13,7 +13,7 @@ f () throw (short)
throw 'a';
}
main ()
int main ()
{
std::set_terminate (my_term);
std::set_unexpected (my_unexp);

View File

@ -11,7 +11,7 @@ public:
A*(*A::ptr)(int) = &A::func;
main()
int main()
{
A foo;

View File

@ -2,7 +2,7 @@
void f (int *) { }
void f (char, char);
main ()
int main ()
{
f (__null);
}

View File

@ -502,7 +502,7 @@ operator<<(ostream& o, const SLS& s)
SLS gsls;
const SLS gcsls;
foo()
int foo()
{
const unsigned SIZE = 20;
@ -563,7 +563,7 @@ foo()
}
// Dummy function so it'll run
main()
int main()
{
cout << "PASS" << endl;
}

View File

@ -14,7 +14,7 @@ public:
void bar() { b::foo(); } // gets bogus error
};
main() {
int main() {
c test;
test.bar();
}

View File

@ -14,7 +14,7 @@ struct B : public A
void func() { foo(); } // ERROR -
};
main()
int main()
{
B b;
b.func();

View File

@ -38,7 +38,7 @@ private:
struct Bar : public Foo {
public:
DoSomething() {
void DoSomething() {
PUB_A = 0;
Foo::A = 0;
printf("%x\n",pX);
@ -57,7 +57,7 @@ public:
}
};
main()
int main()
{
Foo a;

View File

@ -1,6 +1,6 @@
struct A { int i; };
main()
int main()
{
A a1 = { 42 };
A a2 (a1);

View File

@ -2,7 +2,7 @@
struct T { ~T(); };
main()
int main()
{
foo:
T t; // ERROR - redeclared

View File

@ -5,7 +5,7 @@ struct F {
bool b2 : 7;
};
main()
int main()
{
F f = { true, true };

View File

@ -2,7 +2,7 @@
struct A { };
main ()
int main ()
{
bool b = (void*)0;
b = (int A::*)0;

View File

@ -1,4 +1,4 @@
main ()
int main ()
{
bool b = false;
int i = b++;

View File

@ -3,7 +3,7 @@
bool b;
main ()
int main ()
{
return ((!b) != 0);
}

View File

@ -12,7 +12,7 @@ struct A {
void foo (A a)
{ }
main()
int main()
{
foo (1);
return count;

View File

@ -9,7 +9,7 @@ public:
Class varOfClass;
main() {
int main() {
// This MUST be 'const' to generate the error...
const Class arrayOfClass[1] = { varOfClass }; // causes abort
}

View File

@ -2,7 +2,7 @@
// GROUPS passed rtti
// Negative testcase for decls in conditions.
main()
int main()
{
float i;

View File

@ -14,7 +14,7 @@ struct T
operator int () { return i; }
};
main ()
int main ()
{
int t;

View File

@ -11,4 +11,4 @@ struct T {
void T::f() { printf ("%p", &letter); }
const char T::letter; // still need def after class
main() { }
int main() { }

View File

@ -4,7 +4,7 @@ extern int i;
const int bar = i;
int i = 5;
main()
int main()
{
return bar != 5;
}

View File

@ -30,7 +30,7 @@ typedef unsigned short Type;
typedef Container<Type> TypeContainer;
main(void)
int main(void)
{
TypeContainer myTypeContainer(2);
Type t = myTypeContainer;

View File

@ -1,6 +1,6 @@
// PRMS id: 8279
main ()
int main ()
{
char *const *p = 0;
char **q = 0;

View File

@ -2,7 +2,7 @@ struct A {
A();
A(A); // ERROR - copy ctor must take reference
};
main()
int main()
{
A a;
A b(a); // causes compiler segfault

View File

@ -15,7 +15,7 @@ void f(void)
r = 0;
}
main()
int main()
{
struct xx p;

Some files were not shown because too many files have changed in this diff Show More