OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/trunk/gnu-old/gcc-4.2.2/gcc/testsuite/g++.old-deja/g++.brendan
    from Rev 154 to Rev 816
    Reverse comparison

Rev 154 → Rev 816

/err-msg6.C
0,0 → 1,7
// { dg-do assemble }
// GROUPS passed error-messages
class foo {
public:
~bar () {}// { dg-error "" } destructor `bar' must match class name `foo'.*
};
 
err-msg6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bit-fields2.C =================================================================== --- bit-fields2.C (nonexistent) +++ bit-fields2.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed bit-fields + struct S { + char c; + int i:8; + } s; + + int main() + { + int &ir = s.i; // { dg-error "" } address of bitfield + int *ip = &s.i; // { dg-error "" } address of bitfield + ir = 10; + }
bit-fields2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash42.C =================================================================== --- crash42.C (nonexistent) +++ crash42.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed old-abort +int fn();// { dg-error "" } ambiguates.* +int x; +int& fn() {// { dg-error "" } new decl.* +return x;}
crash42.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash25.C =================================================================== --- crash25.C (nonexistent) +++ crash25.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class memo{ +public: + static int rep; +}; + +class port_head : public memo { +public: + static int rep; + unsigned cap(); +}; + +class buff_head : private port_head { +public: + static int rep; + port_head::cap; +};
crash25.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility1.C =================================================================== --- visibility1.C (nonexistent) +++ visibility1.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed visibility +class foo { +protected: + int i; // { dg-error "" } protected +}; + +class bar : public foo { +public: + friend void baz (foo *); +}; + +void baz (foo *f) +{ + f->i = 1; // error: i is protected// { dg-error "" } .* +}
visibility1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: union1.C =================================================================== --- union1.C (nonexistent) +++ union1.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do run } +// GROUPS passed unions +// This is fixed by finish_anon_union doing a string_cst_equal check on +// the DECL_SIZE of the decls, instead of comparing the DECL_SIZE nodes. + +// The compiler currently fails to allocate space for the static union. + + unsigned + hash(const double d) + { + static union { + unsigned asint[2]; + double asdouble; + }; + asdouble = d; + return asint[0] ^ asint[1]; + } + +int main () +{ + hash (3.1415); +}
union1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new2.C =================================================================== --- new2.C (nonexistent) +++ new2.C (revision 816) @@ -0,0 +1,68 @@ +// { dg-do run } +// GROUPS passed operator-new +// Check that if there is a user defined class-specific operator +// new for a given class, that operator is invoked when a new +// object of the class is requested, regardless of whether or not +// there is also a constructor for the given class, and regardless +// of whether or not the constructor for the given class is defined +// before or after the new operator is even declared. + +extern "C" int printf (const char *, ...); + +typedef __SIZE_TYPE__ size_t; + +struct base { + int i; + + base () + { + i = 7; + } + + void * operator new (size_t size); + void operator delete (void*); +}; + +class derived : public base { + int j; +}; + +int new_call_count = 0; +int expected_size = 0; +int errors = 0; + +int main () +{ + base* base_ptr; + derived* derived_ptr; + + expected_size = sizeof (int); + base_ptr = new base; + expected_size = 2 * sizeof (int); + derived_ptr = new derived (); + + if ((new_call_count != 2) || (errors != 0)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +} + +int allocation_space[100]; +int* allocation_ptr = allocation_space; + +void base::operator delete (void* p) +{ +} + +void *base::operator new (size_t size) +{ + int* return_value = allocation_ptr; + + new_call_count++; + if (size != expected_size) + errors++; + allocation_ptr += (size + sizeof(int) - 1) / sizeof(int); + return (void*) return_value; +}
new2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash67.C =================================================================== --- crash67.C (nonexistent) +++ crash67.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#pragma comment(exestr, "@(#) errno.h 10.2 92/03/26 ")
crash67.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings8.C =================================================================== --- warnings8.C (nonexistent) +++ warnings8.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-Wall" } +// GROUPS passed warnings +bool foo(unsigned char c) +{ + return (c & 17) != 0; +}
warnings8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility9.C =================================================================== --- visibility9.C (nonexistent) +++ visibility9.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed visibility +class A { +public: + void aMethod(void) {};// { dg-error "" } .* +}; + +class AA : A { }; + +class B { +public: + void thisMethod() { + AA ana; + ana.aMethod();// { dg-error "" } .* + } +};
visibility9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template23.C =================================================================== --- template23.C (nonexistent) +++ template23.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class T_Base +{}; + +template +class T_Derived +: public T_Base +{}; + + +class Base +{ +public: + Base (float name); +}; + +class Derived +: public Base +{ +private: + T_Base* data_; // Fix (1): Change date_ from T_Base* to T_Derived* + +public: + Derived (float name); +}; + + +Derived:: +Derived (float name) +: Base(name), + data_(new T_Derived()) +{}
template23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest16.C =================================================================== --- nest16.C (nonexistent) +++ nest16.C (revision 816) @@ -0,0 +1,41 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class BDDHeap { +public: + BDDHeap(); + BDDHeap(const BDDHeap&); + + class Page { + public: + int i; + }; + struct Pointer { + Page *page; + unsigned index; + + Pointer(); + Pointer(const BDDHeap& heap); + }; + + struct Half { + struct { + Page *top; + Page **tail; + } inuse; + + Half(); + }; + + Half half[2]; + unsigned halfspace; +}; + +inline +BDDHeap::Pointer::Pointer(const BDDHeap& heap): +page(0), +index(0) +{ + Page *x = heap.half[heap.halfspace].inuse.top; + page = x; +} +
nest16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typedef1.C =================================================================== --- typedef1.C (nonexistent) +++ typedef1.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do assemble } + +class baseClassA +{ +public: +private: + class internalClassA + { + public: + private: + typedef int privateType; + + privateType memberA; + }; +}; + +class baseClassB +{ +public: +private: + class internalClassA + { + public: + private: + typedef unsigned int privateType; + + privateType memberB; + }; +};
typedef1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl3.C =================================================================== --- redecl3.C (nonexistent) +++ redecl3.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed redeclaration +class foo +{ +public: + int bar(int a); +}; + + +void bar(int &a); + +int foo::bar(int a) { + int a = 0; // Should this be an error ?// { dg-error "" } declaration.* + + bar(a); + return 0; +}
redecl3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc8.C =================================================================== --- misc8.C (nonexistent) +++ misc8.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +// used to say invalid lvalue in `&\' +class foo { + int a; + public: + foo(int a); +}; + +foo::foo(int a) +{ + foo::a=a; +} + +int main() +{ +foo obj(4); +}
misc8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init2.C =================================================================== --- init2.C (nonexistent) +++ init2.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed initialization +// this should give an error in require_instantiated_type about not +// being allowed to have an initializer list in an argument list. +int f(int a = {1});// { dg-error "" } .*
init2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse1.C =================================================================== --- parse1.C (nonexistent) +++ parse1.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed parsing +class Try { +private: + char s; +public: + // an escaped double-quote should not call consume_string inside + // reinit_parse_for_block + void mf() { s='\"'; } +}; + +int main() +{ + Try x; + x.mf(); +} +
parse1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc10.C =================================================================== --- misc10.C (nonexistent) +++ misc10.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +// The compiler shouldn't give a `invalid operands to binary +' for this +// case. +enum flag { OFF, ON }; +enum BOOL { FALSE = (enum flag) 0, TRUE };
misc10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy4.C =================================================================== --- copy4.C (nonexistent) +++ copy4.C (revision 816) @@ -0,0 +1,59 @@ +// { dg-do run } +// GROUPS passed copy-ctors +// Using Cfront 3.0.1 the programm below prints +// +// A() +// A(const A& a) +// ~A() +// A(A& a) <---- !!! +// ~A() +// ~A() +// +// the g++ 2.2.2 (sparc-sun-sunos4.1) generated code prints +// +// A() +// A(const A& a) +// ~A() +// A(const A& a) <---- !!! +// ~A() +// ~A() + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void +die (int x) +{ + if (x != ++count) + { + printf ("FAIL\n"); + exit (1); + } +} + +class A { +public: + A() { die (1); } + A(const A& a) { die (2); } + A(A& a) { die (4); } + ~A() { count++; if (count != 3 && count != 5 && count != 6) die (-1); } +}; + +void foo1(const A& a) { + A b = a; +} + +void foo2( A& a) { + A b = a; +} + +int main() { + A a; + + foo1(a); + foo2(a); + + printf ("PASS\n"); +}
copy4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators1.C =================================================================== --- operators1.C (nonexistent) +++ operators1.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed operators +struct A { + int x; +}; + +int operator()(A x,float y) { // MUST be a member function// { dg-error "" } .* + return 1; +} + +int main() { + A x; + x(1.0); // { dg-error "" } no match for call +}
operators1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: label1.C =================================================================== --- label1.C (nonexistent) +++ label1.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed labels +// it should only give 1 error, about using an undefined label +int main(void) { goto dummy; }// { dg-error "" } .*
label1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template5.C =================================================================== --- template5.C (nonexistent) +++ template5.C (revision 816) @@ -0,0 +1,48 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class Vector +{ +public: + Vector(int x); + ~Vector(); + T& operator [] (int i); + +private: + T* v; + int sz; +} ; + +template +Vector::Vector(int x) +{ + sz = x; + v = new T (sz); +} + +template +Vector::~Vector() + { delete [] v; } + +template +T & +Vector::operator [] (int i) + { return v[i]; } + +int +main(int, char **) +{ + Vector intvec(3); + + intvec[0] = 1; + intvec[1] = 2; + intvec[2] = 3; + + for (int i = 0; i < 3; i++) + intvec[i]; + + return 0; +} + + +
template5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload7.C =================================================================== --- overload7.C (nonexistent) +++ overload7.C (revision 816) @@ -0,0 +1,42 @@ +// { dg-do run } +// GROUPS passed overloading +extern "C" int printf (const char *, ...); + +struct NoName { + + int first; + int second; +}; + +class Casted { + + public: + + NoName x; + double y; + + Casted ( int _x , double _y ): y(_y) + { + x.first = _x; + x.second = _x*2; + } + + operator NoName() const { return x; } + operator double() const { return y; } +}; + +int main() +{ + Casted c(10,12.34); + + NoName x; + double y; + + x = c; + y = c; + + if (x.first == 10 && x.second == 20 && y == 12.34) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
overload7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon-union1.C =================================================================== --- anon-union1.C (nonexistent) +++ anon-union1.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed anonymous-unions +static union { + char* uC; +private: + int uI;// { dg-error "" } .*private member.* +};
anon-union1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash51.C =================================================================== --- crash51.C (nonexistent) +++ crash51.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class obj; + +typedef obj *obj_t; + +class obj { +public: + obj( const obj& o ); +}; + +extern obj nowhere; + +class set: public obj { + unsigned bit_vector; +public: + set( const obj& o ); + set& operator|=( const int q ); +}; + +enum pin_enum { E_F, O_C, O_D, O_S, P_D, P_U, R, T, A, C }; + +set t_q = ( ( ( ( ( ( set( nowhere ) |= E_F ) |= O_C ) |= O_D ) |= O_S ) + |= P_U ) |= P_D ) |= T;
crash51.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash34.C =================================================================== --- crash34.C (nonexistent) +++ crash34.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed old-abort +operator int () {}// { dg-error "" } .*// ERROR - .*
crash34.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash17.C =================================================================== --- crash17.C (nonexistent) +++ crash17.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed old-abort +// +// This one creates +// +// gcc2: Internal compiler error: program cc1plus got fatal signal 11 +// +// when compiled with g++. +// The error goes away, if +// 1) int ClassInvariant() is not virtual or +// 2) GnObject has a virtual destructor or +// 3) GnWidget has no virtual destructor or +// 4) GnContracts has a virtual destructor +// + + +class GnContracts { + public: + virtual int ClassInvariant(); +// virtual ~GnContracts(); +}; + +class GnObject : public GnContracts { + public: +// virtual ~GnObject(); +}; + +class GnWidget : public GnObject { + public: + virtual ~GnWidget(); +}; + +class GnOptionGroup : public GnObject, public GnWidget {// { dg-error "" } warning +}; +
crash17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum14.C =================================================================== --- enum14.C (nonexistent) +++ enum14.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// { dg-options "-fshort-enums" } +// GROUPS passed enums + enum E { A = 0x80000000 };
enum14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ambiguity1.C =================================================================== --- ambiguity1.C (nonexistent) +++ ambiguity1.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed ambiguity +struct A { + A (int); +}; + +struct B { + B (int); +}; + +void myfunc (const A& t0); // { dg-error "" } +void myfunc (const B& t0); // { dg-error "" } + +int main () +{ + myfunc(1); // { dg-error "" } ambiguous call +}
ambiguity1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors2.C =================================================================== --- ctors2.C (nonexistent) +++ ctors2.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do run } +// GROUPS passed constructors +// Check that sub-words sized class members are correctly set +// by constructors. + +extern "C" int printf (const char *, ...); + +struct base { + int f1 : 8; + int f2 : 8; + base (int arg1, int arg2); +}; + + +base global_base(0x55, 0x7e); + +int main () +{ + if ((global_base.f1 != 0x55) || (global_base.f2 != 0x7e)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +} + +base::base(int arg1, int arg2) +{ + f1 = arg1; + f2 = arg2; +}
ctors2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template15.C =================================================================== --- template15.C (nonexistent) +++ template15.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed templates +template class Stack { + public: + Stack (int s = 10); //Comment out "= 10" and it will compile + ~Stack(void); //Omitting "void" doesn't help +}; + +template Stack::~Stack(void) +{ } + +//If this definition comes before the one for ~Stack, the error message +//about redeclaration of `void Stack::~Stack()' will not occur. +template Stack::Stack(int s) +{ } + +int main () { + Stack stk(10); +}
template15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash2.C =================================================================== --- crash2.C (nonexistent) +++ crash2.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed old-abort +// The compiler used to crash on this example. + +class x { +public: + x(); + static const x y[23]; +}; +const x x::y[23];
crash2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum1.C =================================================================== --- enum1.C (nonexistent) +++ enum1.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed enums +class foo { +public: + enum bar { baz = 1, bat = 7 }; +}; + +class derv : public foo { }; + +int main() +{ + foo::bar x = foo::baz; + derv::bar y = derv::bat; +}
enum1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem3.C =================================================================== --- ptrmem3.C (nonexistent) +++ ptrmem3.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do assemble } +// GROUPS passed pointers-to-members +template class TemplA { + T t; +}; + + +template class TemplB { +public: + typedef void (T::*TClassMethod)(); + +private: +/* + This line should not crash cuz of the get_decl_list change in this: + * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't + have TYPE_PTRMEMFUNC_P set before we try to build its + CLASSTYPE_ID_AS_LIST. + (get_decl_list): Likewise, when trying to read it. +*/ + TemplA Tmethod; +}; + + +class C { + int a; +}; + +int main(int, char**) { + + TemplB test; +} +
ptrmem3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum9.C =================================================================== --- enum9.C (nonexistent) +++ enum9.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed enums +enum fig { + figgy, + pudding, // { dg-error "comma at end" } +}; + +class X { +public: + static fig (*open)(void *thing, const char *filename); + static fig (*parse)(void *thing); +}; + +enum fig (*X::open)(void *thing, const char *filename) = 0; +fig (*X::parse)(void *thing) = 0;
enum9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array1.C =================================================================== --- array1.C (nonexistent) +++ array1.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-fconserve-space -fcommon" } +// GROUPS passed array-bindings + +extern "C" int printf (const char *, ...); +char array[~(~0ul>>1)|~(0ul>>3)]; // { dg-error "" } overflow in array dimension.* +int main () { printf ("PASS\n"); return 0; }
array1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg7.C =================================================================== --- err-msg7.C (nonexistent) +++ err-msg7.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class foo { +public: + volatile int () {}// { dg-error "" } +};
err-msg7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash60.C =================================================================== --- crash60.C (nonexistent) +++ crash60.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class X +{ +public: + X (); + int f[4]; +}; + +// Note that we mistakenly initialize the array data member as if it +// was scalar +X::X () : f (0) {}// { dg-error "" } .*
crash60.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash43.C =================================================================== --- crash43.C (nonexistent) +++ crash43.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble { xfail sparc64-*-elf } } +// { dg-options "-g" } +// GROUPS passed old-abort +extern "C" { typedef int jmp_buf[12]; } + +enum Error { NO_ERROR }; +class ErrorHandler +{ + ErrorHandler *previous; + static ErrorHandler *error_stack; + jmp_buf error_buffer; +protected: + static void pop() + { + error_stack = error_stack->previous; + } +public: + jmp_buf *push() + { + previous = error_stack; + error_stack = this; + return &error_buffer; + } +};
crash43.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash26.C =================================================================== --- crash26.C (nonexistent) +++ crash26.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed old-abort +struct B { + B(); +}; + +class C : virtual public B +{ + public: + C() { } +};
crash26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: recurse.C =================================================================== --- recurse.C (nonexistent) +++ recurse.C (revision 816) @@ -0,0 +1,80 @@ +// { dg-do assemble } +// GROUPS passed recursive-aborts +// types +typedef unsigned int DBflag; // for storing user flag value +typedef unsigned long DBoffset; // 32-bit unsigned integer +typedef DBoffset DBsize; // type for storing sizes of objects +typedef unsigned char DBbyte; // 8-bit unsigned char + +class DBlink +{ +protected: + DBbyte link[4]; // hold link in portable MSB first format +public: + DBlink(DBoffset = 0, DBflag = 0); + DBlink &operator=(const DBlink &); + DBlink &operator=(DBoffset); + operator DBoffset(); + operator const DBbyte *() { return link; } + void set_flag() { link[0] |= 0x80; } + void reset_flag() { link[0] &= 0x7f; } + int test_flag() const { return (link[0] & 0x80) != 0; } +}; + +typedef DBlink DBsizerec; // hold data record size in portable format + +// constants +const DBoffset DB_NULL = 0; + +class DBlinkrec +{ +protected: + // offsets are stored with MSB in link[0] + DBlink l; // offset into link file of right child - MSB = red bit + DBlink r; // offset into link file of left child - MSB = delete + DBlink d; // offset into parallel data file - MSB = user flag +public: + DBlinkrec():l(DB_NULL), r(DB_NULL), d(DB_NULL) {} + void make_red() // set link to red + { l.set_flag(); } + void make_black() // set link to black + { l.reset_flag(); } + int is_red() const // indicates whether this is a red link + { return l.test_flag(); } + void set_discard() // set discard flag + { r.set_flag(); } + void reset_discard() // reset discard flag + { r.reset_flag(); } + int is_discarded() const // check discard flag + { return r.test_flag(); } + void set_flag() // set user flag + { d.set_flag(); } + void reset_flag() // reset user flag + { d.reset_flag(); } + int is_flag() const // check user flag + { return d.test_flag(); } + + friend class DataBase; +}; + +class DBpathrec : public DBlinkrec +{ + DBoffset offset; // offset of link record in LNK file +public: + DBpathrec():offset(DB_NULL) { } + DBpathrec(DBoffset off, const DBlinkrec &lr):offset(off), DBlinkrec(lr) {} + operator DBoffset() { return offset; } + DBpathrec &operator=(DBoffset off) { offset = off; return *this; } + DBpathrec &operator=(const DBpathrec &pr) + { offset = pr.offset; (DBlinkrec)*this = (DBlinkrec)pr; return *this; } + + friend class DataBase; +}; + +int main() +{ + DBpathrec a(), b(); + + a = b;// { dg-error "" } non-lvalue in assignment.* +} +
recurse.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings1.C =================================================================== --- warnings1.C (nonexistent) +++ warnings1.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-Wctor-dtor-privacy" } +// GROUPS passed warnings +// there should be a warning about foo only defining private methods +class foo { // { dg-error "" } .* + int bar(); +};
warnings1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility2.C =================================================================== --- visibility2.C (nonexistent) +++ visibility2.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed visibility +class X { + void g (int); // { dg-error "" } private +public: + void g (double); +}; + +class Y : public X { void f() { g (1); } }; // { dg-error "" } private +
visibility2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: def-args1.C =================================================================== --- def-args1.C (nonexistent) +++ def-args1.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// PRMS Id: 10860 +class Beige +{ +public: + static int yellow(); + void white(int green = yellow()); + void aqua(int green = Beige::yellow()); +};
def-args1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: union2.C =================================================================== --- union2.C (nonexistent) +++ union2.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed unions +class B; + +struct A { + A(B* x) : i(x) {} + A() : i(0) {} + + union { + B* i; + B* c; + }; +};
union2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc1.C =================================================================== --- misc1.C (nonexistent) +++ misc1.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +int main( int argc, char**argv, char** envp ){ + char* domain = argv[1]; + domain = domain? (char*)"component" : domain; +}
misc1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new3.C =================================================================== --- new3.C (nonexistent) +++ new3.C (revision 816) @@ -0,0 +1,38 @@ +// { dg-do run { xfail powerpc-ibm-aix* } } +// { dg-options "-flat_namespace" { target *-*-darwin[67]* } } +// GROUPS passed operator-new +#include +#include +#include + +int pass = 0; + +void *operator new(size_t sz) throw (std::bad_alloc) { + + void *p; + + pass = 1; + p = malloc(sz); + return p; +} + +class A { +public: + A() {} + ~A() {} + + int a; + int b; +}; + + +int main() +{ + A *bb = new A[10]; + delete [] bb; + + if (pass) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
new3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt1.C =================================================================== --- cvt1.C (nonexistent) +++ cvt1.C (revision 816) @@ -0,0 +1,44 @@ +// { dg-do assemble } +// GROUPS passed conversions +#include + +class Thing +{ +public: + typedef enum { GOOD_THING, BAD_THING, } ThingType ; // { dg-error "" } comma + Thing (ThingType type) : thingType (type) { } + ~Thing () { } +private: + ThingType thingType ; +} ; + +class Group +{ +public: + typedef enum { THIS_GROUP, THAT_GROUP, } GroupType ; // { dg-error "" } comma + Group (GroupType type) : groupType (type), groupCount (0) { } + ~Group () { } + void append (Thing* const &entry) { groupCount ++ ; } + operator GroupType () const { return groupType ; } + operator int () const { return groupCount ; } // remove this and problem gone + +private: + int groupCount ; + GroupType groupType ; +} ; + +inline Group& operator += (Group& g, Thing* const t) +{ + g.append (t) ; + return g ; // complaint is here +} + +int +main (int argc, char** argv) +{ + Group g (Group::THIS_GROUP) ; + + g += new Thing (Thing::GOOD_THING) ; + std::cout << "Group type is " << (Group::GroupType) g << std::endl ; + return 0 ; +}
cvt1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash68.C =================================================================== --- crash68.C (nonexistent) +++ crash68.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// { dg-options "-w -O" } +// GROUPS passed old-abort +class RWDlist +{ +public: + RWDlist& operator=(const RWDlist&); +}; +class DataItemRWGDlist : public RWDlist {}; + +class Base {}; +class DataItemList : public Base +{ + private: + DataItemRWGDlist m_diList; +}; + +class StatementGroup +{ + public: + DataItemList dataItemList; + StatementGroup(const StatementGroup&); +}; + +StatementGroup::StatementGroup(const StatementGroup& sg) +{ + dataItemList = sg.dataItemList; +}
crash68.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings9.C =================================================================== --- warnings9.C (nonexistent) +++ warnings9.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-Wall" } +// GROUPS passed warnings +inline int foo() +{ + return 3; +}
warnings9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template24.C =================================================================== --- template24.C (nonexistent) +++ template24.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do run } +// GROUPS passed templates +extern "C" int printf (const char *, ...); + +template +class Temp +{ + F func_; +public: + Temp (F f) :func_(f) {} +}; + +int func (int h = 1, int z = 2) { return h+z; } + +int main () +{ + Temp temp (func); + + printf ("PASS\n"); + return 0; +}
template24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest17.C =================================================================== --- nest17.C (nonexistent) +++ nest17.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class T { +public: + typedef int I; + class Y {int y;}; + typedef Y Z; +}; + +T::I i; +T::Y y; +T::Z z;
nest17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc9.C =================================================================== --- misc9.C (nonexistent) +++ misc9.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +//The program listed below produces the following error during compilation: +// % g++ bug17.cc +// bug17.cc: In method `class Y& Y::operator = (const class Y&)': +// bug17.cc:18: invalid use of non-lvalue array + +class X { +public: + X& operator=(const X&) { return *this; } +}; + +struct S { + char c[10]; + X x; +}; + +class Y { + S s; +public: + const S& f() const { return s; } + + Y& operator=(const Y& _Y) { + s = _Y.s; // this line compiles + s = _Y.f(); // this line does not compile + return *this; + } +};
misc9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init3.C =================================================================== --- init3.C (nonexistent) +++ init3.C (revision 816) @@ -0,0 +1,39 @@ +// { dg-do run } +// GROUPS passed initialization +// p2766: Make sure that members are initialized in order of declaration +// in the class, not in order of specification in the mem-initializer list. + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void die () { printf ("FAIL\n"); exit (1); } + +class bar1 { +public: + bar1 (int) { if (count != 0) die (); count = 1; } +}; + +class bar2 +{ +public: + bar2 (int) { if (count != 1) die (); count = 2; } +}; + +class foo +{ +public: + bar1 a; + bar2 b; + foo (int, int); +}; + +// bar1 should get built before bar2 +foo::foo (int x, int y) : b(x), a(y) {} + +int main() +{ + foo f (1, 2); + printf ("PASS\n"); +}
init3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: complex1.C =================================================================== --- complex1.C (nonexistent) +++ complex1.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do run } +// { dg-options "" } + +// This test makes sure that the stuff in lex.c (real_yylex) is +// set up to handle real and imag numbers correctly. This test is against +// a bug where the compiler was not converting the integer `90' to a +// complex number, unless you did `90.0'. Fixed 10/1/1997. + +extern "C" { +int printf (const char *, ...); +void exit (int); +void abort (void); +} + +__complex__ double cd; + +int one = 1; + +int +main() +{ + cd = 1.0+90i; + cd *= one; + + if (__real__ cd != 1 || __imag__ cd != 90) + abort (); + + exit (0); +}
complex1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse2.C =================================================================== --- parse2.C (nonexistent) +++ parse2.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed parsing +class BitString { +public: + int i; +}; + + +typedef BitString BS; +typedef ::BitString cBS;
parse2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc11.C =================================================================== --- misc11.C (nonexistent) +++ misc11.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +// This should not complain about A::f being abstract. +struct A +{ + virtual int f() = 0; +}; + +struct B : virtual A +{ + virtual int f() { return 1; } + virtual int g() = 0; +}; + +struct C: B +{ + int g() { return 2; } +}; + +C c;
misc11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy5.C =================================================================== --- copy5.C (nonexistent) +++ copy5.C (revision 816) @@ -0,0 +1,86 @@ +// { dg-do run } +// GROUPS passed copy-ctors +/* +bad: +sibelius402> a.out +a=5 a.virtMember()=30 +BaseClass::Increm --> {i=5, virtMember()=30} +a=7 a.virtMember()=30 +b=7 b.virtMember()=30 +BaseClass::Increm --> {i=7, virtMember()=999} +b=9 b.virtMember()=30 +sibelius403> + + good: + +sibelius406> a.out +a=5 a.virtMember()=30 +BaseClass::Increm --> {i=5, virtMember()=30} +a=7 a.virtMember()=30 +b=7 b.virtMember()=30 +BaseClass::Increm --> {i=7, virtMember()=30} +b=9 b.virtMember()=30 +*/ + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +void die () { printf ("FAIL\n"); exit (1); } + +class BaseClass { + + friend int operator != (const BaseClass irv, int x); + + int i; + +public: + + BaseClass( const BaseClass& ir ) : i(ir.i) {}; + BaseClass() : i(5) {}; + + virtual int virtMember() { return( 999 ); }; + + void Increm( int r ); +}; + +void BaseClass::Increm( int r ) +{ + if ((i == 5 && virtMember () == 30) + || (i == 7 && virtMember () == 30)) + i += r; + else + die (); +} + +class DerivedClass : public BaseClass { +public: + int virtMember() { return( 30 ); }; +}; + +int operator != (const BaseClass irv, int x) { return irv.i != x; } + +int +main () +{ + DerivedClass a; + + if (a != 5 || a.virtMember () != 30) + die (); + + a.Increm(2); + + if (a != 7 || a.virtMember () != 30) + die (); + + DerivedClass b = a; + + if (b != 7 || a.virtMember () != 30) + die (); + + b.Increm(2); + + if (b != 9 || a.virtMember () != 30) + die (); + + printf ("PASS\n"); +}
copy5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sorry1.C =================================================================== --- sorry1.C (nonexistent) +++ sorry1.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed old-sorry +class a { +public: + int* foo(); +}; + +a aa; +a* ap; + +class b { +public: + int ok(int* p =aa.foo()); + + // dump_init should know what to do with this NON_LVALUE_EXPR + int f(int* p =ap->foo()); +}; + + int +b::ok(int *p) +{ + return 0; +} + + int +b::f(int *p) +{ + return 0; +} + void +bar() +{ + b b; + b.ok(); + b.f(); +}
sorry1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm1.C =================================================================== --- arm1.C (nonexistent) +++ arm1.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed ARM-compliance +// ARM $5.7, it's illegal to do math on a `void*'. + +int +main() +{ + void *p; + ++p;// { dg-error "" } .* +}
arm1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators2.C =================================================================== --- operators2.C (nonexistent) +++ operators2.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed operators +class X { }; +void operator[](X& a, X& b) {} // MUST be a member function// { dg-error "" } .*
operators2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template6.C =================================================================== --- template6.C (nonexistent) +++ template6.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed templates +struct B { +}; + +struct X : B { + ~X (); +}; + +struct Request { + X s; +}; + +template class TC { + ET data; +}; + +struct TMem { + + ~TMem() {} + + TC *req; +}; + +struct FIO { + + void init (); + + FIO () { init(); } +};
template6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash10.C =================================================================== --- crash10.C (nonexistent) +++ crash10.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class word +{ + unsigned char b1, b2; +public: + word (unsigned int i = 0) { b1 = i & 0xff; b2 = (i & 0xff00) >> 8; } + operator unsigned int () { return (b2 << 8) + b1; } +}; + +class just_another +{ + int foo; + char bar[23]; +}; + +int mumble(word w) +{ + just_another *jap; + unsigned bar; + + bar = w; + + jap = new just_another [w]; + + return 0; +} +
crash10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: label2.C =================================================================== --- label2.C (nonexistent) +++ label2.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed labels + +extern "C" void abort(); + +class X { +public: + X(); +}; +void foo () +{ +X: ::abort(); + goto X; +}
label2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: explicit1.C =================================================================== --- explicit1.C (nonexistent) +++ explicit1.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// $7.1.2 disallows explicit on anything but declarations of +// constructors ... including friends. +class foo { public: foo(); }; +class bar { public: friend explicit foo::foo(); }; // { dg-error "" } explicit friend
explicit1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload8.C =================================================================== --- overload8.C (nonexistent) +++ overload8.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// 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;};}; +void zxcvbnm(int n,...){n=1;} +int main(){complex c; Complex C; +zxcvbnm(1,c); +zxcvbnm(1,C);} // { dg-warning "" } cannot pass non pod
overload8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash52.C =================================================================== --- crash52.C (nonexistent) +++ crash52.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-Wreturn-type" } +// GROUPS passed old-abort +#include + +class A { +public: + friend A f(A &a);// { dg-error "" } ambiguates.* +}; + +A &f(A &a) {// { dg-error "" } new decl.* + std::cout << "Blah\n"; +}
crash52.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash35.C =================================================================== --- crash35.C (nonexistent) +++ crash35.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed old-abort +const unsigned int ENET_INTERRUPT_MID = 5; + +extern "C" void ENET_RxP(); + +class EnetReceiver + { + public: + friend void ENET_RxP(); + void receiveMessage(); + int *messagePointer; + }; + +void EnetReceiver::receiveMessage() + { + if (*((unsigned int*) messagePointer) == ENET_INTERRUPT_MID) + { + } + }
crash35.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash18.C =================================================================== --- crash18.C (nonexistent) +++ crash18.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do compile } +// GROUPS passed old-abort +typedef int element; +class Pix { +public: + Pix(); + Pix(const Pix&); + + // Friend functions so that v == x works as does x == v works + friend int operator==(void *v, const Pix& x) // { dg-error "previously" } + { return v == index; } // { dg-error "from this location" } + // ??? should be operator!= + friend int operator==(void *v, const Pix& x) // { dg-error "redefinition" } + { return v != index; } +private: +// friend class List; + element *index; // { dg-error "invalid use of non-static data member" } +};
crash18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload10.C =================================================================== --- overload10.C (nonexistent) +++ overload10.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed overloading +class Bed { + public: + static void bed_func( + int (*f)(int &, int, int)); +}; +class g_func { +public: + static int save_status; + + // in compute_harshness, we should be using comptypes, not ==, to + // check if this is equivalent to the previous decl; the only + // difference is the default arg + static int rpt_func(int &status, int expand, + int restore_cursor=1 ); +}; + +int main (int argc, + char **argv, + char **envp) +{ + Bed::bed_func(g_func::rpt_func); + return(1); +}
overload10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: README =================================================================== --- README (nonexistent) +++ README (revision 816) @@ -0,0 +1,40 @@ + +abstract - abstract functions +alignof - gcc alignof builtin +ambiguity - diagnosing ambiguities +arm - ARM cases +array-refs - arrays of references +bit-fields - bit fields +chainon - deaths cuz we call chainon() incorrectly +copy - copy constructors +crash - old compiler crashes/aborts +cvt - user-defined conversions +def-fns - default function generation (in add'n to copy) +enum-clash - int vs enum +enum - enumerated types +err-msg - error messages +friend - dealing with friend functions and classes +groff - crashes derived from groff code +init - initialization bugs +label - handling labels +line - line numbers in error messages +misc - miscellaneous tests that didn't fit another category +nest - nested types +new-array - doing new of an array +new - generic operator new bugs +operators - tests for various overloaded operators +parse - parser bugs +prepost - prefix/postfix operator ++/-- +ptolemy - bugs derived from ptolemy +recurse - infinite recursion in the compiler +redecl - handling redeclarations +scope - managing scopes +shadow - shadowing of params, etc +sizeof - ARM compliance w/ sizeof operator +sorry - old "sorry, not implemented" messages +static - handling static data +template - template bugs +union - handling unions +visibility - access control and visibility checking +warnings - warning messages +
README Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: prepost1.C =================================================================== --- prepost1.C (nonexistent) +++ prepost1.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed prefix-postfix +class foo { +public: + operator ++ (); // { dg-error "" } no type or storage class +}; + +int main() +{ + foo x; + + // This should fall back to calling operator++(), and be an error with + // the -pedantic flag. + x++;// { dg-error "" } +}
prepost1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors3.C =================================================================== --- ctors3.C (nonexistent) +++ ctors3.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed constructors +class A; + +class B { +public: + B(); +static A sa; +}; + +class A { +public: + A(int i); +}; + +A B::sa(1); +
ctors3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sizeof1.C =================================================================== --- sizeof1.C (nonexistent) +++ sizeof1.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed sizeof +// ARM $5.3.2 + +void f() { } + +int +main() +{ + // sizeof may not be applied to a function + int i = sizeof( f);// { dg-error "" } .* + + return 0; +}
sizeof1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template16.C =================================================================== --- template16.C (nonexistent) +++ template16.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed templates +template class TList { + typedef void (T::*TVOIDFUNT)(); + typedef T* (T::*TTPFUNT)(T*); +}; + +class A; +class B : TList { }; +
template16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash3.C =================================================================== --- crash3.C (nonexistent) +++ crash3.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed old-abort +int strcmp(); + +extern "C" { + // dies in common_type, cuz the TREE_TYPE of t2 is 0, so it can't get its + // TYPE_MAIN_VARIANT value. + // constant permanent 0 + // align 1 symtab 0 + // pointer_to_this + +int strcmp(const char*, const char*); +}
crash3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum2.C =================================================================== --- enum2.C (nonexistent) +++ enum2.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed enums +class foo { +public: + enum bar { baz = 1, bat = 7 }; +}; + +class foo2 { +public: + enum bar2 { baz2 = 1, bat2 = 7 }; +}; + +class derv : public foo, public foo2 { }; + +int main() +{ + foo::bar x = foo::baz; + derv::bar2 y = derv::bat2; +}
enum2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem4.C =================================================================== --- ptrmem4.C (nonexistent) +++ ptrmem4.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed pointers-to-members +class X { + private: + int i; + public: + X(int k) { i=k; } + int operator=(X &a) { return i = a.i; } + int operator=(int ii) { return i = ii; } +}; +int main(void) +{ + int (X::*op1_ptr)(X&); + op1_ptr = &X::operator=; // g++ gives error + return 0; +}
ptrmem4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: code-gen1.C =================================================================== --- code-gen1.C (nonexistent) +++ code-gen1.C (revision 816) @@ -0,0 +1,41 @@ +// { dg-do run } +// GROUPS passed code-generation +// Check that sub-word sized structs/classes are passed correctly +// if the struct/class has a constructor (i.e. ANY constructor). + +extern "C" int printf (const char *, ...); + +struct base { + unsigned int f1 : 8; + unsigned int f2 : 8; + + base (int ii) + { + } +}; + +base global_base (7); + +int test2 (base formal_base); + +int main () +{ + global_base.f1 = 0x55; + global_base.f2 = 0xee; + + if (test2 (global_base) == 0) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } + + return 0; +} + +int test2 (base formal_base) +{ + if (formal_base.f1 != global_base.f1) + return -1; + if (formal_base.f2 != global_base.f2) + return -1; + return 0; +}
code-gen1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary1.C =================================================================== --- temporary1.C (nonexistent) +++ temporary1.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed temporaries +#include + +int main () +{ + int a = 2; + + if (----a == 0) + printf ("a = 0\n"); + + printf ("a = %d\n", a); +}
temporary1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg8.C =================================================================== --- err-msg8.C (nonexistent) +++ err-msg8.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed error-messages +operator int ; int j; // { dg-error "" } declaration of `operator int' as non-function.*
err-msg8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: shadow1.C =================================================================== --- shadow1.C (nonexistent) +++ shadow1.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed errors +void f( int a) { + int a; // this should be an error now// { dg-error "" } .* + { + int a; + } +}
shadow1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash61.C =================================================================== --- crash61.C (nonexistent) +++ crash61.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed old-abort + template class sapp { }; + class foo {}; + extern foo& __iomanip_setw (foo&, TP);// { dg-error "" } type spec.*
crash61.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static1.C =================================================================== --- static1.C (nonexistent) +++ static1.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed static +class A { public: int a; };// { dg-error "" } .* +void foo7 () { A::a = 3; }// { dg-error "" } .*
static1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash44.C =================================================================== --- crash44.C (nonexistent) +++ crash44.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed old-abort +template class bug { + +public: + void Foo(const int = 0); + void NotRedeclared(const int); + +private: + T TheItem; +}; + +template void bug::NotRedeclared(const int) +{ +} + +template void bug::Foo(const int) +{ +} + +int +main() +{ + bug InstantiatedBug; + + return 0; +}
crash44.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash27.C =================================================================== --- crash27.C (nonexistent) +++ crash27.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class First { +public: + First(const First& a); +}; + +class Second { + int i; + First f; +public: + ~Second() {} + Second func(); +}; + +void foo() +{ + extern Second x; + x = x.func(); +}
crash27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest10.C =================================================================== --- nest10.C (nonexistent) +++ nest10.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class A + { + public: + class B + { + public: + int f (); + void g (int); + private: + int b; + }; + }; + +int A::B::f () + { + int val=b; + return val; + } + +void A::B::g (int val) + { + b = val; + } + + +int main () + { + }
nest10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mutable1.C =================================================================== --- mutable1.C (nonexistent) +++ mutable1.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed mutable +class foo; +class bar { + mutable foo const *foobar; +};
mutable1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility3.C =================================================================== --- visibility3.C (nonexistent) +++ visibility3.C (revision 816) @@ -0,0 +1,45 @@ +// { dg-do assemble } +// GROUPS passed visibility +// Used to say: +// manip.cc:17: member `_f' is a private member of class `B' +// manip.cc:17: member `_a' is a private member of class `B' + +class A {}; + +template +class B; + +template +inline A & +operator<< (A &o, const B &m); + +template +class B +{ + A &(*_f) (A &, TP); + TP _a; +public: + B (A &(*f) (A &, TP), TP a) : _f (f), _a (a) {} + friend A &operator<< <>(A &o, const B &m); +}; + +template +inline A & +operator<< (A &o, const B &m) +{ + (*m._f) (o, m._a); + return o; +} + +A &setw (A &, int); +B setw (int n) +{ + return B (setw, n); +} + +A x; + +void f () +{ + x << setw (2); +}
visibility3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings2.C =================================================================== --- warnings2.C (nonexistent) +++ warnings2.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed warnings +class K { +public: + void f() { + }; // there should be no warning about this semicolon +};
warnings2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: union3.C =================================================================== --- union3.C (nonexistent) +++ union3.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed unions +union alan { +int a; +char *b; +alan(); +}; + +alan mary; + +alan::alan() +{ + a=0; +}
union3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc2.C =================================================================== --- misc2.C (nonexistent) +++ misc2.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +// Should be fixed by: +// Sun Jun 13 12:55:22 1993 Brendan Kehoe (brendan@lisa.cygnus.com) +// +// * cp-decl.c (grokvardecl): Don't complain about duplicate +// definitions of `extern "C"' declarations (parallelize it with how +// regular `extern' decls are handled). + +extern "C" double _MaXdOuB, _MiNdOuB; +extern "C" double _MaXdOuB, _MiNdOuB; // no error should be emitted for this
misc2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt2.C =================================================================== --- cvt2.C (nonexistent) +++ cvt2.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed conversions +void f(const short & s) { } + + int +main() { + f(0); + return 0; +}
cvt2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest18.C =================================================================== --- nest18.C (nonexistent) +++ nest18.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +// This is the first line of file ||t2.C||. + +// This code demonstrates what appears to be a bug with nested types. +// In C++, nested typedefs are not supposed to be visible outside +// their class scopes but they apparently are in gcc 2.4.5. This code +// compiles fine in AT&T cfront 3.0.1, but will not compile with gcc. + +// If this class does not precede String, then the code will compile. + +class Another { +public: + typedef int Length; +}; + +// If String does not define typedef int Length, then the code will +// compile. + +class String { +public: + typedef int Length; // remove this and it will compile fine + + int foo(Length length) const; +}; + +int String::foo(Length length) const { + return length; +} + +// File ||t2.C|| ends here.
nest18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template25.C =================================================================== --- template25.C (nonexistent) +++ template25.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class Temp_Base +{}; + +template +class Temp_Derived +: public Temp_Base +{ +public: + Temp_Derived (int i = 10) {} +}; + + +class Base +{ + float r_; +public: + Base (float r) : r_(r) {} +}; + +class Derived +: public Base +{ +private: + Temp_Base* boo_; +public: + Derived (float); +}; + +Derived:: +Derived (float form) +: Base(form), + boo_(new Temp_Derived) +{}
template25.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init4.C =================================================================== --- init4.C (nonexistent) +++ init4.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed initialization +struct CharList { int i; }; + +const CharList& terminals = { 1 };// { dg-error "" } .*
init4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload1.C =================================================================== --- overload1.C (nonexistent) +++ overload1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed overloading +class Foo +{ +public: + int f (void); +}; + +class Bar : public Foo +{ +public: + int f (int); // { dg-error "" } candidates are +}; + +int main () +{ + Bar b; + + b.f ();// { dg-error "" } + b.f (10); +}
overload1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse3.C =================================================================== --- parse3.C (nonexistent) +++ parse3.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } + +// these are marked as expected errors because they evidence an +// ambiguity in the grammar between expressions and declarations. +// when the parser's been cleaned up or rewritten, these two error +// markers can go away, since they'll no longer occur. + +// Fixed. PR 8545, 2001 01 23 +class A +{ + public: + int high; + unsigned int low; + A operator+(const A in); +}; + +A A::operator+(const A in) +{ + if (high==0) + return A(); // this works + else + return (A()); // this works not +}
parse3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy6.C =================================================================== --- copy6.C (nonexistent) +++ copy6.C (revision 816) @@ -0,0 +1,56 @@ +// { dg-do run } +// GROUPS passed copy-ctors +/* +g++ 2.3.3 will prefer using type conversions over the +implicitly generated copy constructor. This is wrong. +If you explicitly define a copy constructor, it will +use it. However, the implicit copy constructor MUST be +called whenever an explicit one would have been called +also. See below: g++ converts from and back into +unsigned, instead of using the implicit copy constructor: +here is the version: +Reading specs from /usr/lib/gcc-lib/i386-linux/2.3.3/specs +gcc version 2.3.3 + /usr/lib/gcc-lib/i386-linux/2.3.3/cpp -lang-c++ -v -undef -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -Dunix -Di386 -Dlinux -D__unix__ -D__i386__ -D__linux__ -D__unix -D__i386 -D__linux bug2.cc /usr/tmp/cca02008.i +GNU CPP version 2.3.3 (80386, BSD syntax) + /usr/lib/gcc-lib/i386-linux/2.3.3/cc1plus /usr/tmp/cca02008.i -quiet -dumpbase bug2.cc -version -o /usr/tmp/cca02008.s +GNU C++ version 2.3.3 (80386, BSD syntax) compiled by GNU C version 2.3.3. + as -o /usr/tmp/cca020081.o /usr/tmp/cca02008.s + ld /usr/lib/crt0.o -nojump -L/usr/lib/gcc-lib/i386-linux/2.3.3 /usr/tmp/cca020081.o -lg++ -lgcc -lc -lgcc + +Ok, and here is the output: +test k: constructing from scratch +test l=k: type conversion into unsigned +constructing from unsigned + +*/ + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void die () { printf ("FAIL\n"); exit (1); } + +struct test { + test() { if (count != 0) die (); } + + test(unsigned) { + die (); + } + operator unsigned() { + die (); + return 0; + } +}; + +int +main() { + test k; + test l=k; + + printf ("PASS\n"); + + return 0; +} +
copy6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators3.C =================================================================== --- operators3.C (nonexistent) +++ operators3.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed operators +class X { }; +void operator->(X& a, X& b) {} // MUST be a member function// { dg-error "" } .*
operators3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm2.C =================================================================== --- arm2.C (nonexistent) +++ arm2.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// ARM 9.4 ``There cannot be a static and a nonstatic member function +// with the same name and the same argument types.'' +// +// The trick is to make sure it's caught with both orders (static, +// then normal, and vice-versa. + +class X { +public: + int foo(); // { dg-error "with" } + static int foo(); // error: redeclaration// { dg-error "overloaded" } .* +}; + +class Y { +public: + static int foo(); // { dg-error "with" } + int foo(); // error: redeclaration// { dg-error "overloaded" } .* +};
arm2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash11.C =================================================================== --- crash11.C (nonexistent) +++ crash11.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed old-abort +extern "C" int printf (const char *, ...); + +class A { + int i; // { dg-error "" } private + int j; // { dg-error "" } private + public: + int h; + A() { i=10; j=20; } + virtual void f1() { printf("i=%d j=%d\n",i,j); } + friend virtual void f2() { printf("i=%d j=%d\n",i,j); }// { dg-error "" } virtual.* +}; + +class B : public A { + public: + virtual void f1() { printf("i=%d j=%d\n",i,j); }// { dg-error "" } member.*// ERROR - member.* + friend virtual void f2() { printf("i=%d j=%d\n",i,j); }// { dg-error "" } virtual.*// ERROR - member.*// ERROR - member.* +}; + +int +main() { + A * a = new A; +}
crash11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template7.C =================================================================== --- template7.C (nonexistent) +++ template7.C (revision 816) @@ -0,0 +1,48 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class ChainElem { +public: + + ET data; +}; + +template +class Chain { +public: + + ChainElem *first; + + virtual ~Chain() {} + +}; + +struct B { +}; + +struct X : B { + ~X (); +}; + +struct TBNFexpression { +}; + +struct TCaseLabelPair { +}; + +struct TVariant { + Chain CaseLabelList; +}; + +struct TCaseConstruct { + Chain TagFieldPrefixes; + Chain Variants; +}; + +struct Production { + X TypeName; +}; + +struct SimpleSyntax { + Chain Productions; +};
template7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload9.C =================================================================== --- overload9.C (nonexistent) +++ overload9.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed overloading +class CLogger +{ +public: + void operator() (int,const char *) {}; // { dg-error "" } candidates + void operator() (int,const char *, ...) {}; // { dg-error "" } candidates +} Log; + +class CGLogger : public CLogger +{ +} GLog; + +int main() +{ + Log(1,"Test");// { dg-error "" } call of.* + Log(1,"Test %d",3); + GLog(1,"Test");// { dg-error "" } call of.* + GLog(1,"Test %d",3); +}
overload9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init10.C =================================================================== --- init10.C (nonexistent) +++ init10.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed initialization +struct S { int :0; } a;
init10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash53.C =================================================================== --- crash53.C (nonexistent) +++ crash53.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class A +{ + public: + class B + { + public: + virtual ~B(); + }; +}; + +template +class C +{ + public: + class B + : public A::B + { + }; // bug2.cc:18: Internal compiler error 233. + // bug2.cc:18: Please submit a full bug report to `bug-g++@prep.ai.mit.edu'. +}; + +C<0> c;
crash53.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash36.C =================================================================== --- crash36.C (nonexistent) +++ crash36.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed old-abort +struct wait { int w_status; }; +int wait(); +extern "C" int wait(int*); + +
crash36.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload11.C =================================================================== --- overload11.C (nonexistent) +++ overload11.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed overloading +class foo_int +{ +public: + int & i; + + foo_int (int &j) : i(j) {}; + void inc () { i++; } + +};
overload11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg10.C =================================================================== --- err-msg10.C (nonexistent) +++ err-msg10.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class foo { +public: + virtual static int f () = 0;// { dg-error "" } member `f' cannot be declared both virtual and static.* +};
err-msg10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: prepost2.C =================================================================== --- prepost2.C (nonexistent) +++ prepost2.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed initialization +class foo { +public: + operator ++ (); // { dg-error "" } no type or storage class + operator ++ (int); // { dg-error "" } no type or storage class + operator ++ (char); // illegal// { dg-error "" } .* + operator ++ (short); // illegal// { dg-error "" } .* + operator ++ (long); // illegal// { dg-error "" } .* +};
prepost2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: reference1.C =================================================================== --- reference1.C (nonexistent) +++ reference1.C (revision 816) @@ -0,0 +1,54 @@ +// { dg-do run } +// { dg-options "-w" } +// GROUPS passed references +// Check that if a reference is initialized to refer to a value +// which is returned from a function call, the actual call to +// the function is only invoked for the original initialization +// of the reference, and not for each subsequent use of the +// reference. +// +// This test fails with G++ 1.35.0- (pre-release). +// Reported 4/4/89 by Kim Smith + +extern "C" int printf (const char *, ...); + +struct base { + mutable int data_member; + + base () {} + void function_member () const; +}; + +base base_object; + +base base_returning_function (); + +int call_count = 0; + +int main () +{ + const base& base_ref = base_returning_function (); + + base_ref.function_member (); + base_ref.function_member (); + base_ref.data_member = 99; + + if (call_count == 1) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } + + return 0; +} + +base base_returning_function () +{ + base local_base_object; + + call_count++; + return local_base_object; +} + +void base::function_member () const +{ +}
reference1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sizeof2.C =================================================================== --- sizeof2.C (nonexistent) +++ sizeof2.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed sizeof +// ARM $5.3.2 + +void f() { } + +struct foo { int bit : 1; }; + +int +main() +{ + // sizeof may not be applied to a bit-field + foo f; + int i = sizeof (f.bit);// { dg-error "" } .* + + return 0; +}
sizeof2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access1.C =================================================================== --- access1.C (nonexistent) +++ access1.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed access-control +class Base +{ +protected: + virtual void DoSomething() = 0; +}; + +class Fibber : public Base +{ +public: + void DoBP() { + DoSomething(); + } +}; + +class Flat : public virtual Fibber +{ +public: + void DoIt() { + DoSomething(); + } +};
access1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template17.C =================================================================== --- template17.C (nonexistent) +++ template17.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed templates +struct Regex { int i; Regex(char *, int); }; +template +class NDAMName { +public: + static const Regex pattern; + static unsigned sequence_number; +}; + +const Regex NDAMName<'L'>::pattern("^[Ll](.*)$", 1);// { dg-error "" } type/value.* +unsigned NDAMName<'L'>::sequence_number = 0;// { dg-error "" } type/value
template17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash4.C =================================================================== --- crash4.C (nonexistent) +++ crash4.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed old-abort +typedef struct Thing { + Thing(); + int x; +} Thing;
crash4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum3.C =================================================================== --- enum3.C (nonexistent) +++ enum3.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed enums +enum foo +{ + x = 0 +}; + +enum bar +{ + // this used to say `x' wasn't a constant, because build_enumerator + // was getting the value of x wrapped around a NOP_EXPR. It now + // strips them off before working on it, so we shouldn't get any + // errors for this. + y = (x + 0x0000) +};
enum3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg1.C =================================================================== --- err-msg1.C (nonexistent) +++ err-msg1.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class A { }; + +int i = A::_ter;// { dg-error "" } ._ter.* +int j = A::term;// { dg-error "" } .term.*
err-msg1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash20.C =================================================================== --- crash20.C (nonexistent) +++ crash20.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#include +typedef std::complex Complex; + +Complex ComputeVVself() +{ +Complex temp1; +Complex self[3][3]; + + self[1][2] = 100.0; + return self[1][2]; + +}
crash20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: code-gen2.C =================================================================== --- code-gen2.C (nonexistent) +++ code-gen2.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do run } +// GROUPS passed code-generation +// Check that declarations with initializations are executed +// correctly. + +extern "C" int printf (const char *, ...); + +int main () +{ + char buff[40] ; + char *tmp = &buff[0]; // also fails for char *tmp = buff; + + if ((__SIZE_TYPE__) tmp != (__SIZE_TYPE__) &buff[0]) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +}
code-gen2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg9.C =================================================================== --- err-msg9.C (nonexistent) +++ err-msg9.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class foo { +public: + int ~foo ();// { dg-error "" } return type specification for destructor invalid.* +};
err-msg9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash62.C =================================================================== --- crash62.C (nonexistent) +++ crash62.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#include + + void + fubar(std::ostream* out, const char* s) + { + (*out) << s << std::endl; + return; + } + + int + main() + { + // Declare a ref and a pointer to the same ostream. + // + std::ostream* out = &std::cerr; + std::ostream& die = std::cerr; + + // Valid call to fubar. + // + fubar(out, "First line."); + + // Invalid call to fubar. (1st arg is an ostream&. fubar expects + // ostream*.)This should be a syntax error, but g++ does not catch it. + // Call to this function results in a bus error in fubar when the 1st + // arg is dereferenced. + // + fubar(die, "Second line.");// { dg-error "" } cannot convert .die.* + + return 1; + }
crash62.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static2.C =================================================================== --- static2.C (nonexistent) +++ static2.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed static +class A +{ + public: + void member(void) + { + } + + static void staticMember() + { + member (); // illegal, no object for calling non-static method// { dg-error "" } .* + } +}; + +int main() +{ + A::staticMember(); +}
static2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash45.C =================================================================== --- crash45.C (nonexistent) +++ crash45.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed old-abort +void foo() { static const char *const v[] = { 0 }; }
crash45.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptolemy1.C =================================================================== --- ptolemy1.C (nonexistent) +++ ptolemy1.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed ptolemy-bugs +class Tcl_Interp; + +class PTcl { +public: + PTcl(Tcl_Interp* interp = 0); + ~PTcl(); + int alias(int argc,char** argv); +}; + +typedef int (PTcl::*InterpFuncP)(int,char**); + +struct InterpTableEntry { + const char* name; + InterpFuncP func; +}; + + +static InterpTableEntry funcTable[] = { + { "alias" , &PTcl::alias } , + 0, 0 +};
ptolemy1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash28.C =================================================================== --- crash28.C (nonexistent) +++ crash28.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed old-abort + class abc + { + public: + void F() { return; } + + private: + typedef int myint; + typedef struct { int b; } mystruct; + typedef union { int c; } myunion; + };
crash28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest11.C =================================================================== --- nest11.C (nonexistent) +++ nest11.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class A { + int x; + + struct B { + int x; + }; + struct C; + friend struct C; + struct C { + int bug (A::B &y); + }; +}; + +int +A::C::bug (A::B &y) +{ + return y.x; +} +
nest11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility4.C =================================================================== --- visibility4.C (nonexistent) +++ visibility4.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed visibility +template +class Feld { +public: + Feld(const Feld&) {} +}; + +class Polynom : private Feld { + Polynom(); + friend Polynom f(const Polynom&); +}; + +Polynom f(const Polynom& p) { return p; }
visibility4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings3.C =================================================================== --- warnings3.C (nonexistent) +++ warnings3.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// { dg-options "-O2 -Wall" } +// GROUPS passed warnings +class A { +int i; +public: + void funcA(void) { + funcB(); + } + + // The compiler should not emit a warning about not being + // able to inline this function. + void funcB(void) { + i++; + } +};
warnings3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtors1.C =================================================================== --- dtors1.C (nonexistent) +++ dtors1.C (revision 816) @@ -0,0 +1,57 @@ +// { dg-do run } +// GROUPS passed destructors +// Check that when an object of a derived class is (implicitly) +// destructed (on exit from the block in which it is declared) +// that the destructor for the base class also gets executed. +// +// (also check that this execution doesn't seg-fault) + +extern "C" int printf (const char *, ...); + +int derived_destructed; +int base_destructed; + +struct base { + int base_data_member; + + base() + { + base_data_member = 0x5e5e; + } + ~base() + { + base_destructed = 0x781f; + } +}; + +struct derived : public base { + int derived_data_member; + + derived() + { + derived_data_member = 0xe5e5; + } + ~derived() + { + derived_destructed = 0xf178; + } +}; + + +void test2 (); + +int main () +{ + test2 (); + if ((base_destructed != 0x781f) || (derived_destructed != 0xf178)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +} + +void test2 () +{ + derived derived_object; + + derived_object.derived_data_member = 99; +}
dtors1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: asm-extn1.C =================================================================== --- asm-extn1.C (nonexistent) +++ asm-extn1.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble { target sparc-sun-* } } +// { dg-options "-S" } +// GROUPS passed asm-extension +// This used to crash because c_expand_asm_keyword didn't know what to +// do with this. The parser rules were changed to accept an expr, instead +// of a stmt. + +extern void traptable(void); + +main() +{ + asm("wr %0,%%tbr" : : "r" (traptable)); +}
asm-extn1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc3.C =================================================================== --- misc3.C (nonexistent) +++ misc3.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +// The compiler should not error about taking the addr of main in this example. +class fred { +private: + void main () { + } +public: + fred ( ) { + &fred::main; + } +};
misc3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt3.C =================================================================== --- cvt3.C (nonexistent) +++ cvt3.C (revision 816) @@ -0,0 +1,48 @@ +// { dg-do assemble } +// GROUPS passed conversions +class GttObject {}; +class GctObject: virtual public GttObject {}; +class NDAMObject: virtual public GttObject, virtual public GctObject {}; +class GctHashObject: virtual public GctObject {}; + +class GctRef: virtual public GctHashObject +{ public: operator void*() const; }; + +class NDAMAssemblerObject: virtual public NDAMObject {}; +class GctReferenceObject: virtual public GctHashObject {}; +class NDAMValue: virtual public NDAMAssemblerObject, public GctReferenceObject {}; + +class nnyacc; +class NDAMValueRef : virtual public NDAMObject, public GctRef +{ + NDAMValue *operator->() const; + operator NDAMValue *() const; +friend class nnyacc; +}; + +typedef void* Pix; +class NDAMValueRefSLList +{ +public: + NDAMValueRefSLList(); + NDAMValueRefSLList(const NDAMValueRefSLList& a); + ~NDAMValueRefSLList(); + NDAMValueRef& operator () (Pix p) const; +}; + +struct bar +{ + NDAMValueRefSLList *valueList; +}; + +class nnyacc +{ +public: + static void assign(void*& lval, void*& rval); // { dg-error "" } candidates +}; + +void +foo (bar yylval, bar *yyvsp) +{ + nnyacc::assign(yylval.valueList, yyvsp[0].valueList);// { dg-error "" } +}
cvt3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template26.C =================================================================== --- template26.C (nonexistent) +++ template26.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// GROUPS passed templates +class V { + public: + V(); + V(int); + }; + +template class AA: public virtual V { + public: + AA(); + AA(int); + }; + +template class BB : public virtual V { + public: + BB(); + BB(int); + }; + +template AA::AA() {} +template AA::AA(int i): V(i) {} +template BB::BB() {} +template BB::BB(int i) {} + +class CC : public AA<1>, public BB<2> { + public: + CC(); + CC(int); + }; +
template26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest19.C =================================================================== --- nest19.C (nonexistent) +++ nest19.C (revision 816) @@ -0,0 +1,40 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +// This is the first line of file ||t3.C||. + +// This code demonstrates a variation of the same problem with nested +// types. In C++, nested typedefs are not supposed to be visible +// outside their class scopes but they apparently are in gcc 2.4.5. +// This code compiles fine in AT&T cfront 3.0.1, but gcc rejects it +// with the messages given below. + +// If this class does not precede Expr, then the code will compile. + +class Another { +public: + typedef int Boolean; + enum { FALSE, TRUE }; +}; + +// If Expr does not define typedef int Boolean, then the code will +// compile. + +class Expr { +public: + typedef int Boolean; + enum { FALSE, TRUE }; + void foo(); + void call_something_with(Boolean); +}; + +// t3.C: In method `void Expr::foo ()': +// t3.C:36: uninitialized const `Boolean' +// t3.C:36: parse error before `=' +// t3.C:37: `argument' undeclared (first use this function) +// t3.C:37: (Each undeclared identifier is reported only once +// t3.C:37: for each function it appears in.) + +void Expr::foo() { + const Boolean argument = TRUE; + call_something_with(argument); +}
nest19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init5.C =================================================================== --- init5.C (nonexistent) +++ init5.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed initialization +int main( int argc, char**argv, char** envp ){ + char* domain = argv[1]; + domain = domain? (char*)"component" : domain; +}
init5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope1.C =================================================================== --- scope1.C (nonexistent) +++ scope1.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed scoping +int f (int i) { + if (i) + for (int j = i; j; j--) + ; + return j; // error: j should only be in scope inside the body of `for'// { dg-error "" } .* +}
scope1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload2.C =================================================================== --- overload2.C (nonexistent) +++ overload2.C (revision 816) @@ -0,0 +1,44 @@ +// { dg-do run } +// GROUPS passed overloading +// Check that calls to the correct overloaded virtual +// functions are generated even where the type of the formal +// arguments for the overloadings are similar or related. + +extern "C" int printf (const char *, ...); + +int proper_method_called = 0; + +struct base { + int member; + virtual void method (char) + { + } + virtual void method (char *) + { + } +}; + +struct derived : public base { + int member; + virtual void method (char) + { + } + virtual void method (char *) + { + proper_method_called++; + } +}; + +char *message; + +int main () +{ + derived derived_object; + + derived_object.method (message); + + if (proper_method_called != 1) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
overload2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse4.C =================================================================== --- parse4.C (nonexistent) +++ parse4.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } + +class B +{ +public: + B( int t ) {} + void f() {} +}; + +int g() { return 0; } // referenced below + +int main() +{ + int try1; + B( try1 ).f(); // no syntax error + B b( g() ); // no syntax error + B( ::g() ).f(); // no syntax error + B( g() ).f(); // no syntax error +}
parse4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy7.C =================================================================== --- copy7.C (nonexistent) +++ copy7.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do run } +// GROUPS passed copy-ctors +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +void die () { printf ("FAIL\n"); exit (1); } + +class B { +public: + B() {} + B(const B &) { printf ("PASS\n"); exit (0); }; +private: + int x; +}; + +class A : public B { +public: + A() {} + + A(const B &) { printf ("FAIL\n"); exit (1); } +}; + +int +main() +{ + A a; + A b(a); + + printf ("FAIL\n"); + return 1; +}
copy7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm3.C =================================================================== --- arm3.C (nonexistent) +++ arm3.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed initialization +// ARM $11.4: A function first declared in a friend decl is equivalent +// to an extern decl, so the below is illegal. + +class X { + friend g(); // { dg-error "" } previous declaration +}; +static g() { return 1; }// { dg-error "" } previously declared
arm3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators4.C =================================================================== --- operators4.C (nonexistent) +++ operators4.C (revision 816) @@ -0,0 +1,124 @@ +// { dg-do assemble } +// { dg-options "" } + +// GROUPS passed operators +// Check that the & operator, when applied to a global function +// or member function returns a proper value as long as the context +// in which the result of & is used requires a pointer to a specific +// unambigous (function-pointer) type. +// +// This test fails (in test5()) when compiled with g++ 1.34.1. + +extern "C" int printf (const char *, ...); + +int function (char c); +int function (float f); + +class base { + int filler; +public: + int method (char); + int method (float); +}; + +void* vp; + +typedef int (*ptr_to_func_of_char)(char); +typedef int (*ptr_to_func_of_float)(float); +typedef int (base::*ptr_to_method_of_char)(char); +typedef int (base::*ptr_to_method_of_float)(float); + +int test2 (void*); +int test3 (void*); +int test4 (void*); +int test5 (void*); + +base* base_ptr; + +int fail () +{ + printf ("FAIL\n"); + return 1; +} + +int main () +{ + base_ptr = new base; + + ptr_to_func_of_char p0 = &function; + vp = (void*) p0; + if (test2 (vp)) + return fail (); + ptr_to_func_of_float p1 = &function; + vp = (void*) p1; + if (test3 (vp)) + return fail (); + ptr_to_method_of_char p2 = &base::method; + vp = (void*) p2; // { dg-error "" } + if (test4 (vp)) + return fail (); + ptr_to_method_of_float p3 = &base::method; + vp = (void*) p3; // { dg-error "" } + if (test5 (vp)) + return fail (); + + printf ("PASS\n"); + return 0; +} + +int test2 (void* vp) +{ + char ch = 'x'; + + return (((ptr_to_func_of_char)vp)(ch) != 9901); +} + +int test3 (void* vp) +{ + float flt = 9.9; + + return (((ptr_to_func_of_float)vp)(flt) != 9902); +} + +int test4 (void* vp) +{ + char ch = 'x'; + ptr_to_method_of_char p = (ptr_to_method_of_char) vp; // { dg-error "" } bad type conversion + + return ((base_ptr->*p)(ch) != 9904); +} + +int test5 (void* vp) +{ + float flt = 9.9; + ptr_to_method_of_float p = (ptr_to_method_of_float) vp; // { dg-error "" } bad type conversion + + if ((base_ptr->*p)(flt) != 9905) { + return 1; + } else + return 0; +} + +int function (char c) +{ + c = c; + return 9901; +} + +int function (float f) +{ + f = f; + return 9902; +} + +int base::method (char c) +{ + c = c; + return 9904; +} + +int base::method (float f) +{ + f = f; + return 9905; +}
operators4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template8.C =================================================================== --- template8.C (nonexistent) +++ template8.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed templates +#include + +// make sure we accept unions for templates +template +union Double_alignt{ + double for_alignt; + char array[n]; + +}; + +int main(){ + + + Double_alignt<20000> heap; + + printf(" &heap.array[0] = %d, &heap.for_alignt = %d\n", &heap.array[0], &heap.for_alignt); + +}
template8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash12.C =================================================================== --- crash12.C (nonexistent) +++ crash12.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class X +{ + int i; +public: + X(int j); +} + +X *x = new X[10]();// { dg-error "" } .*
crash12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init11.C =================================================================== --- init11.C (nonexistent) +++ init11.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed initialization +struct String { + char * string; + String(const char* st); +}; + +extern char array []; +static String sub = array;
init11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new-array.C =================================================================== --- new-array.C (nonexistent) +++ new-array.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed operator-new +typedef struct { + int a; +} AStruct; + +void MakeBug() { + AStruct *job; + + // This used to crash, it should now give error(s). + job = new AStruct[];// { dg-error "" } .* + + job = new AStruct; +} + +int main () { + MakeBug(); +}
new-array.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash54.C =================================================================== --- crash54.C (nonexistent) +++ crash54.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed old-abort +int main() +{ + int a[100], **p; + + p = &a[50];// { dg-error "" } assignment to.* + +}
crash54.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash37.C =================================================================== --- crash37.C (nonexistent) +++ crash37.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed old-abort +typedef int _sigset_t; +extern "C" { + extern int sigaction(int signo, const struct sigaction *action_spec_p, struct sigaction *old_action_p); +} +extern "C" { + extern void foo(); +} +class SS { + friend void foo(); +protected: + void goo(); +}; +inline void +SS::goo() { }
crash37.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest20.C =================================================================== --- nest20.C (nonexistent) +++ nest20.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +// This is the first line of file ||t5.C||. + +// This code initializing an unnamed union inside a class appears to +// be legal C++ input and compiles fine with AT&T cfront 3.0.1, but +// gcc 2.4.5 complains about multiple initializations of the same +// member. + +class Expr { +public: + enum Type { undefined, slong, ulong, ldouble }; + Expr(); + Expr(Type type, const Expr* initializer); +private: + Type type_; + union { + long slong_; + unsigned long ulong_; + long double ldouble_; + }; +}; + +// Construct an undefined expression. + +Expr::Expr() + : + type_(undefined), + slong_(-1) +{}
nest20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: eh1.C =================================================================== --- eh1.C (nonexistent) +++ eh1.C (revision 816) @@ -0,0 +1,63 @@ +// { dg-do run } +// { dg-options "-O" } +// PRMS Id: 10776 + +extern "C" int printf (const char *, ...); + +class Foo +{ + public: + Foo(int n) : n_(n) { } + int f() { return n_; } + + int badTest(); + int goodTest(); + + private: + + int n_; +}; + +int Foo::badTest() +{ + try { + throw int(99); + } + + catch (int &i) { + n_ = 16; + } + + return n_; + // On the sparc, the return will use a ld [%l0],%i0 instruction. + // However %l0 was clobbered at the end of the catch block. It was + // used to do an indirect call. +} + + +int Foo::goodTest() +{ + int n; + + try { + throw int(99); + } + + catch (int &i) { + n = 16; + } + + return n_; + // The return will use a ld [%l2],%i0 instruction. Since %l2 + // contains the "this" pointer this works. +} + +int main() +{ + Foo foo(5); + foo.goodTest(); + foo.badTest(); + + // the badTest will have failed + printf ("PASS\n"); +}
eh1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg11.C =================================================================== --- err-msg11.C (nonexistent) +++ err-msg11.C (revision 816) @@ -0,0 +1,3 @@ +// { dg-do assemble } +// GROUPS passed error-messages +void foo (mutable int x);// { dg-error "" } non-member `x' cannot be declared `mutable'.*
err-msg11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: prepost3.C =================================================================== --- prepost3.C (nonexistent) +++ prepost3.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed prefix-postfix +class Y { +public: + friend Y operator++ (Y&); + friend Y operator++ (Y&, char); // illegal// { dg-error "" } .* +};
prepost3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sizeof3.C =================================================================== --- sizeof3.C (nonexistent) +++ sizeof3.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed sizeof +// ARM $5.3.2 + +class bar; + +int +main() +{ + // sizeof may not be applied to an undefined class + int k = sizeof (bar);// { dg-error "" } .* + + return 0; +}
sizeof3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template18.C =================================================================== --- template18.C (nonexistent) +++ template18.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed templates +template class X; +typedef X IX; + +template +class X { +public: + T x; +}; + +struct A { + IX c; +};
template18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: groff1.C =================================================================== --- groff1.C (nonexistent) +++ groff1.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do run } +// GROUPS passed groff +/* This should compile properly with the new overloading scheme. */ + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int win = 0; + +class symbol +{ +public: + symbol(const char *p, int how = 0) {} + symbol() {} +}; + +class dictionary +{ +public: + void lookup(symbol s, void *v=0) { win = 1; } + void lookup(const char *) {} +}; + +int main() +{ + char buf[2048]; + dictionary exceptions; + unsigned char *tem = new unsigned char[19 + 1]; + + exceptions.lookup (symbol (buf), tem); + + printf (win ? "PASS\n" : "FAIL\n"); + exit (! win); +}
groff1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash5.C =================================================================== --- crash5.C (nonexistent) +++ crash5.C (revision 816) @@ -0,0 +1,105 @@ +// { dg-do assemble } +// GROUPS passed old-abort +// Should have been fixed by: +// +// Sun Jun 13 12:55:22 1993 Brendan Kehoe (brendan@lisa.cygnus.com) +// +// * cp-cvt.c (build_default_binary_type_conversion): Look deeper into +// what ARG1 and ARG2 are if they're POINTER_TYPEs. + +class CountableSet +{ + public: + virtual ~CountableSet() { } +}; + +template +class FixedSet : virtual public CountableSet +{ + public: + virtual int Get(int, T&) = 0; + virtual ~FixedSet() { } +}; + +class ShrinkableSet +{ + public: + virtual int Remove(int) = 0; +}; + +template +class PVSet : virtual public FixedSet, virtual public ShrinkableSet +{ + public: + virtual void Append(const T&) = 0; + virtual void operator+=(const T& a) { Append(a); } + virtual ~PVSet() { } +}; + +template +class MutSet : virtual public FixedSet, virtual public FixedSet +{ + protected: + typedef T *Tp; + + public: + void Append(const Tp& tp) { Append(*tp); } + + T& Access(int p) + { + Tp tp; + Get(p, tp); + return *tp; + } + virtual ~MutSet() { } +}; + +template +class SimpleSet : virtual public MutSet +{ + protected: + T *array; + int size; + + virtual void Allocate(int s) + { + array = new T[s]; + } + public: + SimpleSet() + { + size = 0; + array = 0; + } + int Get(int p, T& t) + { + t = array[p-1]; + return 1; + } + int Get(int p, T *& t) + { + t = &array[p-1]; + return 1; + } + inline void Append(const T& a) + { + array[size-1] = a; + } + inline int Remove(int n) { return 0; } +}; + +class Dummy +{ + public: + Dummy() {} +}; + +int +main() +{ + SimpleSet bs1; + int i, j; + Dummy foo; + + bs1+=&foo;// { dg-error "" } no .* +}
crash5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum4.C =================================================================== --- enum4.C (nonexistent) +++ enum4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed enums +class X { +public: + enum { a }; +}; + +enum { b = 1 }; +enum ok { y = b }; +enum notok { z = X::a };
enum4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest1.C =================================================================== --- nest1.C (nonexistent) +++ nest1.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +int x; +class enclose { +public: + int x; + + class inner { + public: + void f (int i) { + x = i;// { dg-error "" } .* + } + }; +}; +
nest1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg2.C =================================================================== --- err-msg2.C (nonexistent) +++ err-msg2.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed error-messages + +typedef void (*pfv)(double, double); +extern "C" { + typedef void (*pfv)(double, double); // { dg-error "" "" { xfail *-*-* } } conflicting linkage +} +
err-msg2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: code-gen3.C =================================================================== --- code-gen3.C (nonexistent) +++ code-gen3.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do run } +// GROUPS passed code-generation +// Check that passing things which are not a multiple of +// 4 bytes in size doesn't mess up other subsequent parameters. + +extern "C" int printf (const char *, ...); + +struct base { + int f1 : 8; + int f2 : 8; +}; + +base global_base; + +int val1; + +int test2 (struct base formal_base, int v1); + +int main () +{ + val1 = 0x5e5e; + return test2 (global_base, val1); +} + +int test2 (struct base formal_base, int v1) +{ + formal_base.f1 = formal_base.f2; // prevent warnings + + if (v1 != 0x5e5e) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +}
code-gen3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash63.C =================================================================== --- crash63.C (nonexistent) +++ crash63.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class String + { + public: + String (const char *str); + }; + +class UnitList + { + public: + UnitList (...); + }; + +UnitList unit_list (String("keV")); // { dg-warning "" } cannot pass non-pod
crash63.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash46.C =================================================================== --- crash46.C (nonexistent) +++ crash46.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class Rational { +public: + Rational(int v): value(v) + { } + + int value; +}; +typedef Rational __Rational; + +extern int operator>(const Rational&, const Rational&); + +class V { +public: + class Rational { + public: + static int x(const __Rational& value); + }; +}; + +int +V::Rational::x(const __Rational& value) +{ + return value > 0; +}
crash46.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static3.C =================================================================== --- static3.C (nonexistent) +++ static3.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed static +class foo{ +public: + static void bar( int i ){ value = i; } + static int value;// { dg-error "" } .* +}; + +const int foo::value = 0; // should be an error.// { dg-error "" } .* + +int main(){ + foo::bar( 1 ); + return 0; +} +
static3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash29.C =================================================================== --- crash29.C (nonexistent) +++ crash29.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed old-abort + +union Value +{ + Value(){} +}; + +struct GlobalAddress +{// { dg-error "" } candidates .* + GlobalAddress(Value *nvar){}// { dg-error "" } .* +}; + +int +main() +{ + new GlobalAddress(Value()); // internal error occured here// { dg-error "" } no matching function .* + //new GlobalAddress(new Value()); // This line is correct code +}
crash29.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptolemy2.C =================================================================== --- ptolemy2.C (nonexistent) +++ ptolemy2.C (revision 816) @@ -0,0 +1,69 @@ +// { dg-do run } +// GROUPS passed ptolemy-bugs +#include + +class PTcl { +public: + int dispatcher(int which,int argc,char** argv); + // fns in the table + int one(int argc, char** argv); + int two(int argc, char** argv); + int three(int argc, char** argv); +}; + +// An InterpFuncP is a pointer to an PTcl function that takes an argc-argv +// argument list and returns TCL_OK or TCL_ERROR. + +typedef int (PTcl::*InterpFuncP)(int,char**); + +struct InterpTableEntry { + const char* name; + InterpFuncP func; +}; + +// Here is the function table and dispatcher function. +// These macros define entries for the table + +#define quote(x) #x +#define ENTRY(verb) { quote(verb), &PTcl::verb } + +static InterpTableEntry funcTable[] = { + ENTRY(one), + ENTRY(two), + ENTRY(three), + {0, 0} +}; + +int PTcl::dispatcher(int which, int argc, char** argv) { + return (this->*(funcTable[which].func))(argc, argv); +} + +void printargs(char** argv) { +// while (*argv) { +// cout << " " << *argv++; +// } +// cout << "\n"; +} + +int PTcl::one(int, char** argv) { + std::cout << "FAIL\n"; + printargs(argv); + return 1; +} + +int PTcl::two(int, char** argv) { + std::cout << "PASS\n"; + printargs(argv); + return 0; +} + +int PTcl::three(int, char** argv) { + std::cout << "FAIL\n"; + printargs(argv); + return 1; +} + +int main (int argc, char** argv) { + PTcl obj; + return obj.dispatcher(1,argc,argv); +}
ptolemy2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings4.C =================================================================== --- warnings4.C (nonexistent) +++ warnings4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed warnings +int +main () +{ + register int x; + int * foo = &x; // in C++ it's perfectly legal to do this + + return 0; +}
warnings4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility5.C =================================================================== --- visibility5.C (nonexistent) +++ visibility5.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed visibility +template class B; +template class A {int n; friend class B;}; +template class B {public: void method(A) const;}; +template void B::method(A X) const {X.n=0;} +typedef B<2> B2; +
visibility5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest12.C =================================================================== --- nest12.C (nonexistent) +++ nest12.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +struct enclose { + class nested; + nested *nptr; + class nested { + int x; + }; + void f(); +}; + +void enclose::f() +{ + nptr = new enclose::nested; +} + +void g() +{ + enclose obj; + obj.nptr = new enclose::nested; +}
nest12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtors2.C =================================================================== --- dtors2.C (nonexistent) +++ dtors2.C (revision 816) @@ -0,0 +1,75 @@ +// { dg-do run } +// GROUPS passed destructors +// Check that virtual destructors work correctly. Specifically, +// check that when you destruct an object of a derived class for +// which the base class had an explicitly declared virtual destructor +// no infinite recursion occurs. +// +// Bug description: +// The generated g++ code apparently calls the base class destructor via +// the virtual table, rather than directly. This, of course, results in the +// infinite recursion. + +extern "C" int printf (const char *, ...); + +int errors = 0; + +struct base { + int member; + base(); + virtual ~base(); +}; + +base::base() +{ +} + +base::~base() +{ +} + +struct derived : public base +{ + int member; + derived(); + ~derived(); +}; + +derived::derived() : base() +{ +} + +int derived_destructor_calls = 0; + +extern void exit (int); + +derived::~derived() +{ + if (++derived_destructor_calls > 2) + errors++; +} + +void test (); + +int main () +{ + test (); + + if (errors) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +} + +base* bp; + +void test() +{ + derived a; + + a.member = 99; + bp = new derived; + delete bp; +}
dtors2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc4.C =================================================================== --- misc4.C (nonexistent) +++ misc4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +// This should not emit an error about A::~A() being redefined; we +// should check that it is a pure virtual. +class A { +public: + virtual ~A() = 0; +}; + +A::~A() {}
misc4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt4.C =================================================================== --- cvt4.C (nonexistent) +++ cvt4.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed conversions +class A {}; + +template +class B +{ + A &(*_f) (A &, TP); + TP _a; +public: + B (A &(*f) (A &, TP), TP a) : _f (f), _a (a) {} + friend A &operator<< (A &o, const B &m) + { (*m._f) (o, m._a); return o; } +}; + +A &setw (A &, int); +B setw (int n) +{ + return B (setw, n); +} + +A x; + +void f () +{ + x << setw (2); +}
cvt4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template27.C =================================================================== --- template27.C (nonexistent) +++ template27.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed templates + template class MapLS { }; + class String {}; + class X1 { }; + class RefProto { }; + template class Ref { }; + + template <> + class MapLS >: public MapLS { + public: + ~MapLS(); + }; + + MapLS >::~MapLS() { }
template27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: abstract1.C =================================================================== --- abstract1.C (nonexistent) +++ abstract1.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed abstract-functions +class O +{ +public: + virtual int c()=0; +}; + +class I: public O +{ +}; + +class S: public virtual I +{ +public: + int c(); + virtual int v()=0; +}; + +class D: public S +{ + int v(); +}; + +D *p=new D();
abstract1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init6.C =================================================================== --- init6.C (nonexistent) +++ init6.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed initialization +class Tag { +public: + Tag(int i):value(i){} + int value; +}; + +extern const Tag myTag; +extern const Tag myTag=9; + +// The compiler should not issue an error on this line; expand_static_init +// should be checking that there's no initializer for this line, and thus +// doesn't need to produce an error. +extern const Tag myTag;
init6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope2.C =================================================================== --- scope2.C (nonexistent) +++ scope2.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// GROUPS passed scoping +class A +{ + public: + A() {} + ~A() {} + virtual void f() {} +}; + +class B : public A +{ + public: + B() {} + ~B() {} + virtual void f() {} +}; + + +B GLOBAL_B; + +B& foo() {return GLOBAL_B;} + +int main() +{ + // build_scoped_method_call and build_scoped_ref should know how + // to deal with a reference for this + foo().A::f(); +}
scope2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template1.C =================================================================== --- template1.C (nonexistent) +++ template1.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed templates +// g++-2.2.1: member functions returning a template type + + +template struct list { }; + +struct A +{ + list L; + + list get_list(); + +}; + + +list A::get_list() { return L; }
template1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload3.C =================================================================== --- overload3.C (nonexistent) +++ overload3.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed overloading +typedef int rutBoolean; + +class rutBigIntRep +{ +public: + friend rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b); + operator rutBoolean() const; +protected: + enum Kluge {kluge}; + rutBigIntRep(Kluge) {} + rutBigIntRep(); + rutBigIntRep(const rutBigIntRep& value); + rutBigIntRep& operator=(const rutBigIntRep& value); +}; + +rutBoolean operator>(const rutBigIntRep& a, const rutBigIntRep& b) { + // This should not result in a warning. It used to warn about the + // conversion from int to enum while exploring the possibility of + // converting `a' via `operator rutBoolean', then using the + // rutBigIntRep(Kluge) constructor. It later realizes it shouldn't + // do this, but the call to build_type_conversion was ending up with + // a warning in convert. + rutBigIntRep diff(a); + return 0; +}
overload3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse5.C =================================================================== --- parse5.C (nonexistent) +++ parse5.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } + + +class ptr8 + { +public: + ptr8(unsigned char *string,int len); + }; + +template +class buf + { +public: + buf(const ptr8& aRef); + }; + +int main() + { + unsigned char b[3]; + buf<3> b2(ptr8(&b[0],3)); + }
parse5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc14.C =================================================================== --- misc14.C (nonexistent) +++ misc14.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +class X { +public: + enum e { + New // { dg-error "conflicts with previous" } + , // { dg-error "comma at end" } + }; + + static int New(int); // { dg-error "declaration of" } +}; + +int main() {}
misc14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy8.C =================================================================== --- copy8.C (nonexistent) +++ copy8.C (revision 816) @@ -0,0 +1,68 @@ +// { dg-do run } +// GROUPS passed copy-ctors +/* +This report is for GCC 2.3.3 running on a Sun/4. The bug is that when +a class instance is passed-by-value, GCC does not correctly copy the value. +At the end of this report is an example program that demonstrates the bug. +It should print: + + construct A('x') + copy A('x') + destruct A('x') + destruct A('x') + +and in fact does for IBM's xlC C++. However, for GCC 2.3.3, it fails +to print the second line ["copy A('x')"], which indicates that it failed +to call the copy-constructor for class A when it should have. Below is a +typescript that lists the program, shows how I compiled it, and shows the +incorrect output. +*/ + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void +die (int x) +{ + if (x != ++count) + { + printf ("FAIL\n"); + exit (1); + } +} + +class A { // Class with explicit & instrumented copy-constructor and destructor. +public: + const char * id; + A( const char * id1 ) : id(id1) { die (1); } + + // Copy constructor + A( const A& a ) : id(a.id) { die (2); } + + // Destructor + ~A() { count++; if (count != 3 && count != 4) die (-1); } +}; + +class X { // Class without explicit copy-constructor +private: + A a; +public: + X( const char * id ) : a(id) {} +}; + +void Func( X x ) { // Function with call-by-value argument +} + +int +main() { + X x("x"); // Construct instance of x. + + // The next line should call the copy-constructor for X since x is + // being passed by value. For GCC 2.3.3 on a Sun/4, it does not. + Func(x); + + printf ("PASS\n"); + return 0; +}
copy8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash30.C =================================================================== --- crash30.C (nonexistent) +++ crash30.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#include + +int +main(void) { + + std::string a[] = {"Hello"}; + +}
crash30.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators5.C =================================================================== --- operators5.C (nonexistent) +++ operators5.C (revision 816) @@ -0,0 +1,53 @@ +// { dg-do run } +// GROUPS passed operators +// Check that operators may be (directly) recursive. + +extern "C" int printf (const char *, ...); + +struct base { + int i; +}; + +base base_variable; + +base operator+ (const base& left, const base& right) +{ + base ret_val; + + ret_val.i = left.i + right.i; + return ret_val; +} + +base operator- (const base& left, int right) +{ + base ret_val; + + ret_val.i = left.i - right; + return ret_val; +} + +// Define the unary ! operator for class base to be the fibonachi +// operator. + +base operator! (const base& right) +{ + if (right.i < 2) + return right; + else + return ((!(right-1)) + (!(right-2))); +} + +int main () +{ + base k; + + k.i = 15; + k = !k; // fib it! + + if (k.i != 610) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +}
operators5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash13.C =================================================================== --- crash13.C (nonexistent) +++ crash13.C (revision 816) @@ -0,0 +1,37 @@ +// { dg-do assemble } +// { dg-options "-Wreturn-type" } +// GROUPS passed old-abort +class gen_op +{ +public: + gen_op ( ); + gen_op (const gen_op &Op1); + ~gen_op ( ); + void operator = (const gen_op &Op1); +}; + + + + +class spin_op +{ +public: + spin_op(); + spin_op(const spin_op& SOp); + ~spin_op(); + void operator= (const spin_op& SOp); + operator gen_op(); +}; + + +spin_op Fe(); + + +gen_op Spul_U_axis() +{ + gen_op U1; + U1 = Fe(); +} // { dg-error "" } reaches end of non-void function + +int +main () {}
crash13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum10.C =================================================================== --- enum10.C (nonexistent) +++ enum10.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed enums +class Type +{ + public: + + enum name + { + A + }; +}; + +class A +{ +}; + +class B: public A +{ + public: + B(); +};
enum10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init12.C =================================================================== --- init12.C (nonexistent) +++ init12.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed array-bindings +char * bob(); + +int main() +{ + char a[1][2]; + a[0] = bob();// { dg-error "" } .* +}
init12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash55.C =================================================================== --- crash55.C (nonexistent) +++ crash55.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do compile } +// GROUPS passed old-abort + extern int f(int); // { dg-error "ambiguates" } + + int& f(int x) // { dg-error "new declaration" } + { + int local; // { dg-error "reference to local" } + + local = x+2; + + return local; + }
crash55.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash38.C =================================================================== --- crash38.C (nonexistent) +++ crash38.C (revision 816) @@ -0,0 +1,43 @@ +// { dg-do assemble } +// GROUPS passed old-abort +/* + I received the following message when using g++ (version 2.3.3): + + main.cc: In method 'Implicit,3>::Implicit()': + main.cc: Internal compiler error 241. + main.cc: Please report this to 'bug-g++@prep.ai.mit.edu' + */ + +#include + +class INTEGER { +int x; +public: + typedef int BASE; + INTEGER(int y) : x(y) {} + INTEGER() {} + void encode() { std::cout << "Integer encoder";} + int operator=(int y) { x=y; return x; } + operator int() {return x; } +}; + +template< class T, int n> class Implicit : public T { + public: + typedef typename T::BASE BASE; + Implicit(BASE value ): T(value) {}; + Implicit() : T() {}; + int myTag() { return n; } + void encode() { T::encode(); } + BASE operator=(BASE t) { return T::operator=(t); } +}; + +int +main() +{ + Implicit , 3> y; + + y = 10; +} + + +
crash38.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool1.C =================================================================== --- bool1.C (nonexistent) +++ bool1.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed boolean +int +main() +{ + typedef char Boolean; // Instrinsic.h + Boolean c = false; + bool b = true; + + if (!c != !b) + ; +}
bool1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest21.C =================================================================== --- nest21.C (nonexistent) +++ nest21.C (revision 816) @@ -0,0 +1,97 @@ +// { dg-do run } +// GROUPS passed nested-classes +#include +#include +#include + +static char output[1024]; + +class BDDRetrace { +public: + class Dump { + public: + virtual Dump& operator<<(char c) = 0; + virtual Dump& operator<<(int i) = 0; + virtual Dump& operator<<(double r) = 0; + }; + + class Dump1: public Dump { + public: + Dump& operator<<(char c); + Dump& operator<<(int i); + Dump& operator<<(double r); + }; +}; + +class Dump2: public BDDRetrace::Dump { +public: + BDDRetrace::Dump& operator<<(char c); + BDDRetrace::Dump& operator<<(int i); + BDDRetrace::Dump& operator<<(double r); +}; + +BDDRetrace::Dump& +BDDRetrace::Dump1::operator<<(char c) +{ char tempout[1024]; + std::sprintf(tempout, "%s%s%c", output, "1-", c); + std::strcpy(output, tempout); + return *this; +} + +BDDRetrace::Dump& +BDDRetrace::Dump1::operator<<(int i) +{ char tempout[1024]; + std::sprintf (tempout, "%s%s%d", output, "1-", i); + std::strcpy (output, tempout); + return *this; } + +BDDRetrace::Dump& +BDDRetrace::Dump1::operator<<(double r) +{ char tempout[1024]; + std::sprintf (tempout, "%s%s%1.0f", output, "1-", r); + std::strcpy (output, tempout); + return *this; } + +BDDRetrace::Dump& +Dump2::operator<<(char c) +{ char tempout[1024]; + std::sprintf (tempout, "%s%s%c", output, "2-", c); + std::strcpy (output, tempout); + return *this; } + +BDDRetrace::Dump& +Dump2::operator<<(int i) +{ char tempout[1024]; + std::sprintf (tempout, "%s%s%d", output, "2-", i); + std::strcpy (output, tempout); + return *this; } + +BDDRetrace::Dump& +Dump2::operator<<(double r) +{ char tempout[1024]; + std::sprintf (tempout, "%s%s%1.0f", output, "2-", r); + std::strcpy (output, tempout); + return *this; } + +int main() +{ + BDDRetrace::Dump1 d1; + Dump2 d2; + + std::sprintf (output, " "); + + d1 << 'a'; + d1 << 1; + d1 << 1.0; + + d2 << 'a'; + d2 << 1; + d2 << 1.0; + + if (std::strcmp (output, " 1-a1-11-12-a2-12-1") == 0) + std::printf ("PASS\n"); + else + { std::printf ("FAIL\n"); return 1; } + + return 0; +}
nest21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template11.C =================================================================== --- template11.C (nonexistent) +++ template11.C (revision 816) @@ -0,0 +1,47 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class aCallback +{ +public: + aCallback(Called& obj, int (Called::*met)()); + + int callback(); + +protected: + +private: + // the object to call + Called& object; + + // the method to apply + int (Called::*method)(); + +}; + +template +aCallback::aCallback(Called& obj, + int (Called::*met)()) : +object(obj), +method(met) +{} + +template +int aCallback::callback() +{ + return (object.*method)(); +} + +struct myStruct +{ + int action() {return 24;}; +}; + +int main() +{ + myStruct toto; + + aCallback cb(toto, &myStruct::action); + + return cb.callback(); +}
template11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg12.C =================================================================== --- err-msg12.C (nonexistent) +++ err-msg12.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class foo { +public: + friend mutable int x ();// { dg-error "" } non-object member `x' cannot be declared `mutable' +};
err-msg12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: prepost4.C =================================================================== --- prepost4.C (nonexistent) +++ prepost4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed prefix-postfix +class Y { +public: + friend Y operator++ (Y&); + + // This is legal---it's a good test to make sure that grokfndecl's + // checking of the arguments is sane. + friend Y operator++ (Y&, int); +};
prepost4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sizeof4.C =================================================================== --- sizeof4.C (nonexistent) +++ sizeof4.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed sizeof +// ARM $5.3.2 + +int +main() +{ + // sizeof may not be applied to the type void + int l = sizeof (void);// { dg-error "" } .* + + return 0; +}
sizeof4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template19.C =================================================================== --- template19.C (nonexistent) +++ template19.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class Base +{ +public: + Base() { } +}; + +template +class Middle : public Base +{ +public: + Middle (keyType const & (*ko) (memberType const &)) + { + } +}; + +// EXCHANGE the following lines for this code to work. +//template class Middle; +template class Middle; + +struct Test : public Middle +{ + Test(); +};
template19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash6.C =================================================================== --- crash6.C (nonexistent) +++ crash6.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed old-abort +// Should be fixed by: +// Sun Jun 13 12:55:22 1993 Brendan Kehoe (brendan@lisa.cygnus.com) +// +// * cp-decl.c (start_function): Avoid a null-reference on CTYPE. + +template +class Program { +} ; + +template<> +class Program<0> { +public: + inline friend float EvalNextArg() + { return 1.0 ; } +} ;
crash6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend1.C =================================================================== --- friend1.C (nonexistent) +++ friend1.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed friends +class A +{ +private: + A () {} + +friend struct B; +}; + +class B +{ +public: + A a; +}; + +B b; + +int main () {}
friend1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum5.C =================================================================== --- enum5.C (nonexistent) +++ enum5.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed enums +enum Thing { FIRST, SECOND } ; + +int main() +{ + Thing x = FIRST ; + x = 27 ; // this line should be a type error.// { dg-error "" } .* +}
enum5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest2.C =================================================================== --- nest2.C (nonexistent) +++ nest2.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class A { +protected: + class B { + public: + ~B(); + private: + float _datum; + }; +private: + B *_b; +}; + +A::B::~B() +{ + _datum = 8.0; +}
nest2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg3.C =================================================================== --- err-msg3.C (nonexistent) +++ err-msg3.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed error-messages +#include +#include + +// This error should not appear: +// bug.C: In method `test::test(const class test &)': +// bug.C:8: field `' not in immediate context + +class test{ +public: + int flags; + test() {}; + }; + +int main() + +{ +return 0; +}
err-msg3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash22.C =================================================================== --- crash22.C (nonexistent) +++ crash22.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed old-abort +struct A { + void a1(); + void a2(); +}; + +struct B { + void A::a1(); // this used to die in chainon(), now grokdeclarator should// { dg-error "" } cannot declare.* + void A::a2(); // should be fixed by the 930629 change.// { dg-error "" } cannot declare.* +};
crash22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: code-gen4.C =================================================================== --- code-gen4.C (nonexistent) +++ code-gen4.C (revision 816) @@ -0,0 +1,33 @@ +// { dg-do run } +// { dg-options "-O" } +// GROUPS passed code-generation +// Options: -O +// +// Check that when an int value is assigned to a short int, the proper +// half of the int (i.e. the low order half) ends up in the short. +// +// This fails with 1.32.0 with -O and f1() is inline. +// +// Workaround - declare "f1_arg" as type "short int". + +#include +#include + +short int v2; + +long v1 = 0x11117777; + +inline void f1 (long f1_arg) +{ + v2 = f1_arg; +} + +int main () +{ + f1 (v1); + + if (v2 != 0x00007777) + abort (); + else + printf ("PASS\n"); +}
code-gen4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash64.C =================================================================== --- crash64.C (nonexistent) +++ crash64.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed old-abort +typedef long unsigned int size_t; +typedef void (*RF_Ptr)(void *); + +struct _im_pers_mem_spec { + _im_pers_mem_spec(void ); + _im_pers_mem_spec(auto int of, auto int n); +}; + +struct _type_desc { + _type_desc(char *, int , RF_Ptr , int , int ,...); +}; + +struct metatype { int base_list; }; + +static _type_desc _type_metatype("metatype", sizeof(metatype), + (RF_Ptr)0, 0, 1, 1, + _im_pers_mem_spec( ((size_t)&((( metatype *)0)-> base_list )) , 1)); // { dg-warning "" } cannot pass non-pod
crash64.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash47.C =================================================================== --- crash47.C (nonexistent) +++ crash47.C (revision 816) @@ -0,0 +1,94 @@ +// { dg-do assemble } +// GROUPS passed old-abort +const int TRUE = 1; +const int FALSE = 0; + +class Rep { +protected: + Rep(): count(0) + { } + Rep(const Rep& other): count(0) + { } + + Rep& operator=(const Rep& other) + { /* DO NOT copy over other.count */ + return *this; } + +public: // TODO - for now + // Because it is to hard to restrict these operations to the descendants + // of Rep that we haven't named yet. So we just make them public. + void inc() + { count++; } + void dec() + { if (0 == --count) delete this; } +private: + unsigned count; +}; + +template +class Ref { +public: + Ref(): rep(0) + { } + Ref(const Ref& other): rep(other.rep) + { if (rep) rep->inc(); } + ~Ref() + { if (rep) rep->dec(); + rep = 0; } + + Ref& operator=(const Ref& other) + { if (rep != other.rep) { + if (rep) rep->dec(); + rep = other.rep; + if (rep) rep->inc(); } + return *this; } + + bool null() const + { return 0 == rep ? TRUE: FALSE; } + bool valid() const + { return 0 != rep ? TRUE: FALSE; } + + REP* operator->() const // should be a valid() reference + { return rep; } + operator REP*() const; // should be a valid() reference + +protected: + REP *rep; + + Ref(REP *r): rep(r) + { if (rep) rep->inc(); } + + Ref& operator=(REP *r) + { if (rep != r) { + if (rep) rep->dec(); + rep = r; + if (rep) rep->inc(); } + return *this; } +}; + +template +Ref::operator REP*() const // should be a valid() reference +{ return rep; } + +template +inline int +operator==(const Ref& a, const Ref& b) +{ return (REP *) a == (REP *) b; } + +template +inline int +operator!=(const Ref& a, const Ref& b) +{ return (REP *) a != (REP *) b; } + +class XRep: public Rep { +public: + int i; +}; + +int +main() +{ + Ref y; + + return y != y; +}
crash47.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings5.C =================================================================== --- warnings5.C (nonexistent) +++ warnings5.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed warnings +enum TypeKind { ATK, BTK } ; + +struct Type { + enum TypeKind kind : 8; + void setBTK(); +}; + +void Type::setBTK() { kind = BTK; }
warnings5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility6.C =================================================================== --- visibility6.C (nonexistent) +++ visibility6.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed visibility +class bottom +{ +public: + int b; // { dg-error "" } private +}; +class middle : private bottom +{ +public: + void foo () { b; } +}; +class top : public middle +{ +public: + void bar () { b; }// { dg-error "" } .* +};
visibility6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template20.C =================================================================== --- template20.C (nonexistent) +++ template20.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed templates +template class Map; + +class Foo +{ +public: + static Map bar; +}; + +template +class Map +{ +public : + int find(); +}; + +int main() +{ + int z = Foo::bar.find(); +}
template20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest13.C =================================================================== --- nest13.C (nonexistent) +++ nest13.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +// The bug here is that wer'e getting a message about inner not +// being a basetype itself. I think it's because it's being +// compared as the "inner" we knew about when it was forward-declared, +// versus the "inner" we know about when it *has* been defined. + +class temp +{ +public: + struct inner; + inner *trump() + { + return (tt); + } + struct inner + { + int ll; + }*tt; +};
nest13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtors3.C =================================================================== --- dtors3.C (nonexistent) +++ dtors3.C (revision 816) @@ -0,0 +1,67 @@ +// { dg-do run } +// GROUPS passed destructors +// Check that member and base classes get properly destructed +// when an object of a derived class is destructed via a pointer +// to it which only has a "compile-time" type of "pointer-to-base". +// +// Note that in order for this test to work properly, the destructor +// for the base class should be explicitly declared to be virtual. + +extern "C" int printf (const char *, ...); + +int member_destructor_calls = 0; +int middle_destructor_calls = 0; + +struct member_type { + int data_member; + member_type () {} + ~member_type (); +}; + +struct base { + int data_member; + base () {} + virtual ~base (); +}; + +struct middle : public base { + member_type member1; + member_type member2; + middle () {} + ~middle (); // should be implicitly virtual +}; + +struct derived : public middle { + member_type member1; + member_type member2; + //~derived () {} +}; + +int main () +{ + base* bp = new derived; + delete bp; + derived *dp = new derived; + delete dp; + + if ((member_destructor_calls != 8) || (middle_destructor_calls != 2)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +} + +member_type::~member_type () +{ + member_destructor_calls++; +} + +base::~base () +{ +} + +middle::~middle () +{ + middle_destructor_calls++; +}
dtors3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc5.C =================================================================== --- misc5.C (nonexistent) +++ misc5.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +class A { + static A aa[2]; +}; + +A A::aa[2]; // should be completely legal
misc5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt5.C =================================================================== --- cvt5.C (nonexistent) +++ cvt5.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed conversions +typedef unsigned long Array[3]; + +void sample(const unsigned long (&an_array)[3]); + +class Sample + { + public: + void simple(const Array &an_array); + static void sample(const Array &an_array); + }; + +class A + { + public: + Array array; + }; + + Sample s; + + void simple(const A &a) + { + s.simple(a.array); + sample(a.array); + Sample::sample(a.array); + }
cvt5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template28.C =================================================================== --- template28.C (nonexistent) +++ template28.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed templates +class X { + const char *fptr; +public: + X(const char *ptr) { fptr = ptr; } + operator const char*() { return fptr; } +}; + +int main(){ + X x1("1234"); + X x2(x1+1); +}
template28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility10.C =================================================================== --- visibility10.C (nonexistent) +++ visibility10.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed visibility +struct base +{ + protected: + void base_func() {}// { dg-error "" } .*is protected.* +}; + +struct derived : public base +{ + protected: + void derived_func(base *ptr) { ptr->base_func(); }// { dg-error "" } within this context +}; +
visibility10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init7.C =================================================================== --- init7.C (nonexistent) +++ init7.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed initialization +struct myChoiceList +{ + int bla; + int blubb; + int brummbrumm; +}; + +extern const myChoiceList foo; + +extern const myChoiceList foo = {1,1,1}; + +// finish_decl should have an exclusion so an error is not produced +// for this line. +extern const myChoiceList foo;
init7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy1.C =================================================================== --- copy1.C (nonexistent) +++ copy1.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do run } +// GROUPS passed copy-ctors +extern "C" int printf (const char *, ...); +int count = 0; + +class C { +public: + C (int) { count++; } + operator int () { return 0; } +}; + +int +main () +{ + C c1 (1); + C c2 (c1); + + if (count != 1) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
copy1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope3.C =================================================================== --- scope3.C (nonexistent) +++ scope3.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed scoping +// This is fixed when NEW_CLASS_SCOPING is on. + +template +class ArrayG { +public: + ArrayG(); +protected: + const unsigned INITIAL; + T* array; +}; + +template +ArrayG::ArrayG(): +array(new T[INITIAL]) +{ } + +struct X { + struct Correspondence { + int i; + }; + + void fill(ArrayG& a); +};
scope3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template2.C =================================================================== --- template2.C (nonexistent) +++ template2.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class Conc { +public: + static int body(); +}; + +template +int Conc::body() {return 0;} + +int main () { + Conc s2; +}
template2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload4.C =================================================================== --- overload4.C (nonexistent) +++ overload4.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed overloading + typedef void * (*NewObject) (void); + + class B + { + public: + static void WantsNew (NewObject creator); // { dg-error "" } candidates are + }; + + class A + { + public: + static A * NewOne (void); + + static void InitClass (void) + { + B::WantsNew ( (NewObject) A::NewOne ); + // This used to die in convert_harshness_{ansi,old} cuz it + // didn't know what to do about a void type. + B::WantsNew ( A::NewOne );// { dg-error "" } + } + };
overload4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse6.C =================================================================== --- parse6.C (nonexistent) +++ parse6.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } + +class A { }; + +int main() { + A a = a; + A b(b); +}
parse6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc15.C =================================================================== --- misc15.C (nonexistent) +++ misc15.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs + +struct A { + int aa; +}; +struct B : public A { +}; +struct C : public A { +}; +struct D : public C, public B { + void fun() { C::aa = 10; } +};
misc15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy9.C =================================================================== --- copy9.C (nonexistent) +++ copy9.C (revision 816) @@ -0,0 +1,46 @@ +// { dg-do run } +// GROUPS passed copy-ctors +#include + +// token types: from state parser +const int T_EOF = 257; +const int T_ERROR = 258; +const int T_Float = 259; +const int T_Int = 260; +const int T_ID = 261; +const int T_STRING = 262; + +class Complex; +class State; + +// token, from state parser. +class ParseToken { +public: + int tok; + union { + char cval; + const char *sval; + int intval; + double doubleval; + Complex* Complexval; + const State* s; + }; + ParseToken () { tok = 0; intval = 0;} +}; + +int +main () { + ParseToken a; + a.tok = T_Float; + a.doubleval = 23.2; + ParseToken b(a); + + if (b.doubleval == 23.2) + std::cout << "PASS\n"; + else + { + std::cout << "FAIL\n"; + return 1; + } +} +
copy9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash31.C =================================================================== --- crash31.C (nonexistent) +++ crash31.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed old-abort +struct mbuf { + struct mbuf *next; +}; + +void* malloc(int); +struct mbuf * +mbuf_allocate(int size) +{ + struct mbuf *bp; + + bp = (struct mbuf *) malloc( 10 /*(unsigned) (size + sizeof(struct mbuf))*/); + return bp; + +}
crash31.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators6.C =================================================================== --- operators6.C (nonexistent) +++ operators6.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed operators +class a { +public: + a* operator->() { return this; } + void p(); +}; + +void a::p() { + operator->(); +}
operators6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash14.C =================================================================== --- crash14.C (nonexistent) +++ crash14.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed old-abort +extern "C" int printf (const char *, ...); + + +class cl +{ + int i; +public: + cl(int j = 0) {i = j;} + int get_i() {return i;} + }; + +int +main() +{ + cl ob[3] = {1, 2, 3}; + int i; + + for(i=0; i<3; i++) + printf("%d\n", ob[i].get_i()); + + return 0; + }
crash14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum11.C =================================================================== --- enum11.C (nonexistent) +++ enum11.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed enums +class X +{ + enum + { + oneMask = 0x0000FFFF, + twoMask = 0x000F0000, + thiMask = 0xFFF00000, // { dg-error "comma at end" } + }; + unsigned int foo; + +public: + X (int) : foo (oneMask | twoMask ) {} // No warning + X () : foo (oneMask | twoMask | thiMask) {} // Warning +};
enum11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init13.C =================================================================== --- init13.C (nonexistent) +++ init13.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed initialization +struct A { + operator int (); +}; + +int i = A();
init13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash56.C =================================================================== --- crash56.C (nonexistent) +++ crash56.C (revision 816) @@ -0,0 +1,389 @@ +// { dg-do assemble } +// { dg-options "" } +// GROUPS passed old-abort + +const bool FALSE = 0; +const bool TRUE = 1; +class ListDProto { +protected: + class link; +public: + ListDProto(); + ListDProto(const ListDProto&); + virtual ~ListDProto(); + void operator=(const ListDProto&); + unsigned length() const; + bool empty() const; + void clear(); + void remove_head(); + void remove_tail(); + class Vix { + public: + Vix(); + friend int operator==(void *v, const Vix& x) + { return v == x.item; } + friend int operator==(const Vix& x, void *v) + { return v == x.item; } + friend int operator!=(void *v, const Vix& x) + { return v != x.item; } + friend int operator!=(const Vix& x, void *v) + { return v != x.item; } + friend int operator==(const Vix& x1, const Vix& x2) + { return x1.owner == x2.owner && x1.item == x2.item; } + friend int operator!=(const Vix& x1, const Vix& x2) + { return x1.owner != x2.owner || x1.item != x2.item; } + bool first; + bool last; + protected: + friend class ListDProto; + Vix(const ListDProto *o, link *i); + const ListDProto *owner; + private: + link *item; + }; + enum Action { NORMAL, REMOVE_CURRENT }; + Vix first() const; + void first(Vix& x) const; + void next(Vix& x) const; + void next(Vix& x, Action a = NORMAL); + Vix last() const; + void last(Vix& x) const; + void prev(Vix& x) const; + void prev(Vix& x, Action a = NORMAL); +protected: + struct link { + link *next; + link *prev; + link(link *n = 0, link *p = 0); + virtual ~link(); + private: + link(const link&); + void operator=(const link&); + }; + unsigned count; + link *list_head; + link *list_tail; + virtual link *copy_item(link *old_item) const = 0; + void prepend(link *item); + void append(link *item); + void prepend(const ListDProto& proto); + void append(const ListDProto& proto); + void remove(link *item); + link *ref(const Vix&) const; +}; +template +class ListD: public ListDProto { +public: + void prepend(const T& item); + void append(const T& item); + const T& head() const; + T& head(); + void head(T& fill) const; + void remove_head() + { ListDProto::remove_head(); } + void remove_head(T& fill); + const T& tail() const; + T& tail(); + void tail(T& fill) const; + void remove_tail() + { ListDProto::remove_tail(); } + void remove_tail(T& fill); + class Vix: public ListDProto::Vix { + public: + Vix(): ListDProto::Vix() + { } + protected: + friend class ListD; + Vix(const ListDProto::Vix& x): ListDProto::Vix(x) + { } + }; + Vix first() const + { return ListDProto::first(); }; + void first(Vix& x) const + { ListDProto::first(x); }; + void next(Vix& x, ListDProto::Action a = NORMAL) const + { ListDProto::next(x, a); }// { dg-error "" } .*// ERROR - .* + Vix last() const + { return ListDProto::last(); } + void last(Vix& x) const + { return ListDProto::last(x); } + void prev(Vix& x, ListDProto::Action a = NORMAL) const + { return ListDProto::prev(x, a); } +protected: + struct link_item: public ListDProto::link { + T item; + link_item(const T& i): link(0, 0), item(i) + { } + private: + link_item(const link_item&); + void operator=(const link_item&); + }; +public: + T& operator()(const Vix& x) + { link_item *li = (link_item *) ref(x); + return li->item; } + const T& operator()(const Vix& x) const + { link_item *li = (link_item *) ref(x); + return li->item; } +private: + ListDProto::link *copy_item(ListDProto::link *old_item) const; +}; +template +class SetLD: private ListD { +public: + SetLD(); + SetLD(const ListD&); + void add(const T& item); + void add(const ListD& other); + void add(const SetLD& other); + void remove(const T& item); + bool contains(const T& item) const; + ListD::length; + ListD::empty; + ListD::clear; + typedef typename ListD::Vix Vix; + ListD::first; + ListD::next; + ListD::operator(); + + using ListD::NORMAL; + using ListD::REMOVE_CURRENT; +}; +extern "C" { +extern void __eprintf (const char *, const char *, unsigned, const char *); +} +extern "C" { +extern void __eprintf (const char *, const char *, unsigned, const char *); +} +template +void +ListD::prepend(const T& item) +{ + link *newl = new link_item(item); + ListDProto::prepend(newl); +} +template +void +ListD::append(const T& item) +{ + link *newl = new link_item(item); + ListDProto::append(newl); +} +template +const T& +ListD::head() const +{ + ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 50 , "0 != list_head" ), 0) )) ; + link_item *h = (link_item *) list_head; + return h->item; +} +template +T& +ListD::head() +{ + ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 59 , "0 != list_head" ), 0) )) ; + link_item *h = (link_item *) list_head; + return h->item; +} +template +void +ListD::head(T& fill) const +{ + ((void) (( 0 != list_head ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 68 , "0 != list_head" ), 0) )) ; + link_item *h = (link_item *) list_head; + fill = h->item; +} +template +void +ListD::remove_head(T& fill) +{ + head(fill); + remove_head(); +} +template +const T& +ListD::tail() const +{ + ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 85 , "0 != list_tail" ), 0) )) ; + link_item *h = (link_item *) list_tail; + return h->item; +} +template +T& +ListD::tail() +{ + ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 94 , "0 != list_tail" ), 0) )) ; + link_item *h = (link_item *) list_tail; + return h->item; +} +template +void +ListD::tail(T& fill) const +{ + ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 103 , "0 != list_tail" ), 0) )) ; + link_item *h = (link_item *) list_tail; + fill = h->item; +} +template +void +ListD::remove_tail(T& fill) +{ + ((void) (( 0 != list_tail ) ? 0 : (__eprintf ("%s:%u: failed assertion `%s'\n", "/home/wbaker/work/include/templates/ListD.body.h" , 112 , "0 != list_tail" ), 0) )) ; + link_item *h = (link_item *) list_tail; + fill = h->item; +} +template +ListDProto::link * +ListD::copy_item(ListDProto::link *old) const +{ + link_item *old_item = (link_item *) old; + link_item *new_item = new link_item(old_item->item); + return new_item; +} +template +SetLD::SetLD(): +ListD() +{ } +template +SetLD::SetLD(const ListD& other): +ListD(other) +{ } +template +void +SetLD::add(const T& item) +{ + if ( ! contains(item) ) + append(item); +} +template +void +SetLD::add(const ListD& other) +{ + typename ListD::Vix x; + for (first(x); 0 != x; next(x)) + add(other(x)); +} +template +void +SetLD::add(const SetLD& other) +{ + const ListD& lother = other; + add(lother); +} +template +void +SetLD::remove(const T& item) +{ + typename ListD::Action a = this->NORMAL; + Vix x; + for (first(x); 0 != x && this->REMOVE_CURRENT != a; next(x, a)) + a = operator()(x) == item ? this->REMOVE_CURRENT: this->NORMAL; // { dg-error "" } .* +} +template +bool +SetLD::contains(const T& item) const +{ + Vix x; + for (first(x); 0 != x; next(x)) { + if (operator()(x) == item)// { dg-error "" } .* + return TRUE; + } + return FALSE; +} +template +int +operator==(const SetLD& a, const SetLD& b) +{ + if (a.length() != b.length()) + return FALSE; + typename SetLD::Vix x; + for (a.first(x); 0 != x; a.next(x)) { + if ( ! b.contains(a(x)) ) + return FALSE; + } + for (b.first(x); 0 != x; b.next(x)) { + if ( ! a.contains(b(x)) ) + return FALSE; + } + return TRUE; +} +template +int +operator!=(const SetLD& a, const SetLD& b) +{ return ! (a == b); } +template +int +operator<=(const SetLD& a, const SetLD& b) +{ + if (a.length() > b.length()) + return FALSE; + typename SetLD::Vix x; + for (x=a.first(); 0 != x; a.next(x)) { + if ( ! b.contains(a(x)) ) + return FALSE; + } + return TRUE; +} +template +int +operator<(const SetLD& a, const SetLD& b) +{ + if (a.length() >= b.length()) + return FALSE; + return a <= b; +} +template +int +operator>(const SetLD& a, const SetLD& b) +{ return ! (a <= b); } +template +int +operator>=(const SetLD& a, const SetLD& b) +{ return ! (a < b); } +class String { }; +class IcaseString: public String { }; +template <> class SetLD< IcaseString >: public SetLD< String > { public: SetLD (): SetLD< String >() { }; SetLD (const ListD< IcaseString >& other): SetLD< String >() { ListD< IcaseString >::Vix x; for (other.first(x); 0 != x; other.next(x)) add(other(x)); }; SetLD (const SetLD & other): SetLD< String >(other) { }; const IcaseString & operator()(const Vix& x) const { return ( IcaseString &) SetLD< String >::operator()(x); } }; typedef SetLD< String > SetLD_String_IcaseString_old_tmp99; typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99; +inline int operator== (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) // { dg-error "operator==" } +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator== (oa, ob); } +inline int operator!= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator!= (oa, ob); } +inline int operator< (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator< (oa, ob); } +inline int operator<= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator<= (oa, ob); } +inline int operator> (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator> (oa, ob); } +inline int operator>= (const SetLD_String_IcaseString_new_tmp99& a, const SetLD_String_IcaseString_new_tmp99& b) +{ +const SetLD_String_IcaseString_old_tmp99& oa = a; +const SetLD_String_IcaseString_old_tmp99& ob = b; +return operator>= (oa, ob); } +typedef SetLD SLDiS; +static void +nop(int i) +{ + SetLD x, y; + nop(x == y); + nop(x != y); +nop(x < y); +nop(x <= y); +nop(x > y); +nop(x >= y); +} + +template class SetLD;
crash56.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash39.C =================================================================== --- crash39.C (nonexistent) +++ crash39.C (revision 816) @@ -0,0 +1,33 @@ +// { dg-do assemble } +// { dg-options "-w" } +// GROUPS passed old-abort +//#include +#include + +class GetOpt +{ +private: + static char *nextchar; + enum OrderingEnum { REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER }; + OrderingEnum ordering; + static int first_nonopt; + static int last_nonopt; + void exchange (char **argv); +public: + char *optarg; + int optind; + int opterr; + + int nargc; + char **nargv; + const char *noptstring; + + GetOpt (int argc, char **argv, const char *optstring); + int operator () (void); +}; +//end +#include + +class foo {public: foo () {}}; +class bar {public: bar (const foo& dflt);}; +class baz: public bar {public: baz (): bar (foo ()) {}};
crash39.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest22.C =================================================================== --- nest22.C (nonexistent) +++ nest22.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class foo { +public: + typedef int bar; + foo::bar fb; // this line causes a syntax error! +};
nest22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template12.C =================================================================== --- template12.C (nonexistent) +++ template12.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed templates +inline void foo (const int &x) {} + +template +inline void foo (const type &x) {x.eat_this_and_die();} + +int main (int argc, char **argv) {foo (argc);}
template12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: delete1.C =================================================================== --- delete1.C (nonexistent) +++ delete1.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed operator-delete +/* ARM $5.3.4 */ +void f(char *p, char *q[], const char *r, const char *s[]) +{ + delete 0; /* illegal: non-pointer */// { dg-error "" } .*expected pointer.* + delete (char*)0; /* no effect */ + delete p; + delete[] q; + delete[4] q; /* ANSI forbids size arg */// { dg-error "" } anachronistic .* + delete r; /* no longer illegal: const */ + delete[] s; + delete[4] s; /* ANSI forbids size arg */// { dg-error "" } anachronistic.* +}
delete1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: sizeof5.C =================================================================== --- sizeof5.C (nonexistent) +++ sizeof5.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do run } +// GROUPS passed sizeof +// ARM $5.3.2 + +extern "C" int printf (const char *, ...); + +class foo {}; + +int +main () +{ + // The size of any class or class object is larger than zero. + int i = sizeof (foo); + if (i > 0) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
sizeof5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash7.C =================================================================== --- crash7.C (nonexistent) +++ crash7.C (revision 816) @@ -0,0 +1,48 @@ +// { dg-do assemble } +// GROUPS passed templates + +template +class Vector +{ + int sz; + T *v; +public: + Vector (int s) : sz (s) { v = new T[sz]; } + ~Vector () { delete[] v; } + T &operator[] (int i) { return v[i]; } + int size () { return sz; } +}; + +template// { dg-error "" } previous definition of T +struct Comparator +{ + typedef T T;// { dg-error "" } use of template type T in typedef to T + static int lessthan (T &a, T &b) { return a < b; } +}; + +template +struct Sort +{ + static void sort (Vector &);// { dg-error "" } use of bad T +}; + +template +void Sort::sort (Vector &v)// { dg-error "" } use of bad T +{ + int n = v.size (); + + for (int i = 0; i < n - 1; i++) + for (int j = n - 1; i < j; j--) + if (Comp::lessthan (v[j], v[j - 1])) + { + typename Comp::T temp = v[j]; + v[j] = v[j - 1]; + v[j - 1] = temp; + } +} + +void +f (Vector &vi) +{ + Sort >::sort (vi); +}
crash7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend2.C =================================================================== --- friend2.C (nonexistent) +++ friend2.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed friends +class X { + int a; +friend void friend_set (X*, int); +}; + +void friend_set (X *p, int i) { p->a = i; } + +void f() +{ + X obj; + friend_set (&obj, 10); +} +
friend2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum6.C =================================================================== --- enum6.C (nonexistent) +++ enum6.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed enums +class X { + private: + enum E1 {a1, b1}; // { dg-error "" } private + public: + enum E2 {a2, b2}; + }; + +void h(X* p) { + X::E2 e2; + int x2 = X::a2; + + X::E1 e1; // { dg-error "" } within this context + int x1 = X::a1; // { dg-error "" } within this context + }
enum6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest3.C =================================================================== --- nest3.C (nonexistent) +++ nest3.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class X { +public: + struct M2 { int m; }; + M2 g(int); +}; + + +X::M2 X::g(int i) { X::M2 m2; return m2; } + +int main() { }
nest3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg4.C =================================================================== --- err-msg4.C (nonexistent) +++ err-msg4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class X { +public: + static int x;// { dg-error "" } previous.* + static int y;// { dg-error "" } previous.* +}; + +unsigned X::x;// { dg-error "" } conflict.* +unsigned X::y;// { dg-error "" } conflict.*
err-msg4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash40.C =================================================================== --- crash40.C (nonexistent) +++ crash40.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class foo { + +public: + + virtual foo &operator <<(foo &(foo::*)(foo &)); +}; + + +foo &foo::operator<<(foo &(foo::*manip)(foo &)) +{ + + (this->*manip)(*this); + + return *this; +}
crash40.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash23.C =================================================================== --- crash23.C (nonexistent) +++ crash23.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed old-abort +// This used to die in chainon; it shouldn't any more. + +class A +{ +public: + class B { + public: + void f (); + void g (int); + }; + void B::f () {}// { dg-error "" } .* + void B::g (int val) {}// { dg-error "" } .* +};
crash23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash65.C =================================================================== --- crash65.C (nonexistent) +++ crash65.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class X { +public: + virtual const char* XY(const void* val) const = 0; +}; + + +class Y : public X { +public: + using X::xy;// { dg-error "" } no memb.* + + using X::z;// { dg-error "" } no memb.* +};
crash65.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash48.C =================================================================== --- crash48.C (nonexistent) +++ crash48.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do compile } +// GROUPS passed old-abort +class internal { // { dg-error "internal::internal" } + int field; + int anotherfield; +}; + +class bug { // { dg-error "bug::bug" } + internal* numbers; + bug(int size); +}; + +bug::bug(int size) // { dg-error "bug::bug" } +{ + numbers = new internal(size * size);// { dg-error "no match" } +} + +int +main() +{ + bug test; // { dg-error "no match" } +}
crash48.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings6.C =================================================================== --- warnings6.C (nonexistent) +++ warnings6.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// { dg-options "-O2 -Wall -ansi -pedantic" } +// GROUPS passed warnings +// should not emit this warning about func: +// x.C:2: warning: invalid storage class for function `func' +// +template inline void func(T) +{ +}
warnings6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility7.C =================================================================== --- visibility7.C (nonexistent) +++ visibility7.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed visibility +class X +{ +public: + void fn ();// { dg-error "" } .* +}; +class Y : private X +{}; + +class Unrelated +{ +public: + void foo () { Y y; y.fn (); }// { dg-error "" } .* +};
visibility7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template21.C =================================================================== --- template21.C (nonexistent) +++ template21.C (revision 816) @@ -0,0 +1,43 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class L { +public: + L(); + + T x[30]; + int doit(int i) const; +}; + +#ifdef BUG +template +int +L::doit(int i) const +{ + return x[i].z; +} +#endif + +class X { +public: + class Y { + public: + Y(); + Y(int); + + int z; + }; + + L ly; +}; + +#ifndef BUG +template +int +L::doit(int i) const +{ + return x[i].z; +} +#endif + +static X x;
template21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl1.C =================================================================== --- redecl1.C (nonexistent) +++ redecl1.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed redeclaration +inline int min(int x, int y) {return x < y ? x : y;} /* 235 */// { dg-error "" } .* +int min(int a, int b); +inline int min(int a, int b) {return (a < b)?a:b;}// { dg-error "" } .*
redecl1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc6.C =================================================================== --- misc6.C (nonexistent) +++ misc6.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous +// test that use of `inline' is forbidden when it should be +inline int i;// { dg-error "" } .* +struct c { inline int i; };// { dg-error "" } .* +int foo (inline int i);// { dg-error "" } .* +inline class c; // { dg-error "" } inline +inline typedef int t; // { dg-error "" } inline +class d { inline friend class c; }; // { dg-error "" } inline
misc6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template29.C =================================================================== --- template29.C (nonexistent) +++ template29.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed templates + template class A + { public: + A(ElementType) {} + ElementType get() const ; + }; + + template ElementType A::get() const + { return ElementType(0); } + +int main() { const A a(3); }
template29.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init8.C =================================================================== --- init8.C (nonexistent) +++ init8.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed initialization +class A +{ +public: + A(const A & a) : i_member(a.i_member) + { + } + A(const int & i) : i_member(i) + { + } + union + { + int i_member; + }; +};
init8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy2.C =================================================================== --- copy2.C (nonexistent) +++ copy2.C (revision 816) @@ -0,0 +1,80 @@ +// { dg-do run } +// GROUPS passed copy-ctors +/* +The old g++ output is + +Item() +Compound() +Pre foo +foo +~Compound() +~Item() +Post foo +~Compound() +~Item() + +The output should be something like (produced from ATT 2.1) + +Item() +Compound() +Pre foo +Item(const Item& i) <------ missing above +foo +~Compound() +~Item() +Post foo +~Compound() +~Item() + +*/ + +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void +die (int x) +{ + if (x != ++count) + { + printf ("FAIL\n"); + exit (1); + } +} + + +class Item { + public: + Item() { die (1); } + Item(const Item& i) { die (4); } + ~Item() { count++; if (count != 7 && count != 10) die (-1); } +}; + + +class Compound { + Item i; + public: + Compound() { die (2); } + ~Compound() { count++; if (count != 6 && count != 9) die (-1); } +}; + + +void foo(Compound a) +{ + die (5); +} + +int +main() +{ + Compound a; + + die (3); + foo(a); + + die (8); + + printf ("PASS\n"); +} +
copy2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope4.C =================================================================== --- scope4.C (nonexistent) +++ scope4.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// GROUPS passed scoping +class BitString { +public: + int i; + int length() const; +}; + +typedef BitString BS; + +class V { +public: + class BitString { + public: + static int x(const ::BitString& value); + static int y(const class ::BitString& value); // should be parsed ok + static int z(const BS& value); + }; +}; + +int +V::BitString::x(const ::BitString& value) +{ return value.length(); } + +int +V::BitString::y(const class ::BitString& value) // should be parsed ok +{ return value.length(); } + +int +V::BitString::z(const BS& value) +{ return value.length(); }
scope4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template3.C =================================================================== --- template3.C (nonexistent) +++ template3.C (revision 816) @@ -0,0 +1,50 @@ +// { dg-do run } +// GROUPS passed templates +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void +die (int x) +{ + if (x != ++count) + { + printf ("FAIL\n"); + exit (1); + } +} + +class A { + public: + void f() const { die (-1); } +}; + + +template +class B : public A { + public: + void f() const; +}; + +template +inline void B::f() const { die (1); } + +template +class C : public A { + public: + void f() const { die (2); } +}; + + +int main() +{ + B b; + C c; + + b.f(); //- bugged, (A::f() called instead of B::f()) + c.f(); //- works fine (C::f() called) + + printf ("PASS\n"); + return 0; +}
template3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload5.C =================================================================== --- overload5.C (nonexistent) +++ overload5.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed overloading +class Foo +{ +public: + int operator << (const signed char&); + int operator << (const unsigned char&); + int operator << (const short&); + int operator << (const unsigned short&); + int operator << (const long&); + int operator << (const unsigned long&); +}; + +int main () +{ + Foo fd; + + // We fixed convert_harshness_ansi so it considers the call to + // <<(const signed char&) to be a trivial conversion. It used + // to always make it a standard conversion, which made it conflict + // with <<(const unsigned char &), which is really a std conv. + fd << (signed char) 0; +}
overload5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ns1.C =================================================================== --- ns1.C (nonexistent) +++ ns1.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed old-abort +struct B +{ + void f(char); + void g(char); +}; + +class C +{ + int g(); +}; + +class D2 : public B +{ + using B::f; // ok: B is a base of D2 + using C::g; // { dg-error "not a base type" } +};
ns1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc16.C =================================================================== --- misc16.C (nonexistent) +++ misc16.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +// Using a typedef causes a compiler error +typedef unsigned int Uint32; + +// Using a define so that there isn't a typedef works OK. +//#define Uint32 unsigned int + +Uint32 func0(Uint32, Uint32) +{ + return 0; +} + +Uint32 func1(Uint32, Uint32) +{ + return 1; +} + +Uint32 (*mf[])(Uint32, Uint32) = {func0, func1};
misc16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: def-fns1.C =================================================================== --- def-fns1.C (nonexistent) +++ def-fns1.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// GROUPS passed default-functions +class dictionary { +public: + dictionary (int); +}; + +class symbol { +public: + symbol (); +}; + +// a default ctor should not be generated for hyphenation_language, +// since a ctor has already been declared; if one is generated, there +// will be an error about not enough args to the ctor for dictionary, +// since dictionary only defines a ctor taking an int (it ALSO should +// not get a default ctor) +struct hyphenation_language { + symbol name; + dictionary exceptions; + hyphenation_language(symbol nm) : name(nm), exceptions(501) {} +};
def-fns1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash32.C =================================================================== --- crash32.C (nonexistent) +++ crash32.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// { dg-options "-fshort-enums" } +// GROUPS passed old-abort +enum Bool { FALSE, TRUE }; +Bool foo () { return TRUE; }
crash32.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators7.C =================================================================== --- operators7.C (nonexistent) +++ operators7.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed operators +class A { + char *p; +public: + operator const char *() const { return p; } +}; + +int foo(const A &a) +{ + return (a != 0); +} +
operators7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash15.C =================================================================== --- crash15.C (nonexistent) +++ crash15.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#include + +class A { + public: + virtual ~A() {std::cout << "executed ~A()\n";} +}; + +class B : public A { + public: + virtual ~B() {std::cout << "executed ~B()\n";} +}; + +int +main() { + std::cout << "starting\n"; + B b; + b.~A(); + std::cout << "done\n"; +} +
crash15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum12.C =================================================================== --- enum12.C (nonexistent) +++ enum12.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed enums +enum Bool { False, True }; + +enum Bool object; + +struct S +{ + Bool field:1; + + void copy_enum_bit_field () const { object = field; } +};
enum12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array-refs.C =================================================================== --- array-refs.C (nonexistent) +++ array-refs.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed arm +int a, b; + +// declaring an array of references should be illegal +int & v[ 2] = { a, b};// { dg-error "" } .*
array-refs.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash57.C =================================================================== --- crash57.C (nonexistent) +++ crash57.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class foo { +private: + char buffer[1024]; +public: + foo(); +}; + +int main() +{ + static foo& a = *(new foo); +}
crash57.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest23.C =================================================================== --- nest23.C (nonexistent) +++ nest23.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class CS { +public: + class PS { + }; +}; + +class NCS: public CS { +public: + class S: public PS { + }; +}; + +int i;
nest23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template30.C =================================================================== --- template30.C (nonexistent) +++ template30.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed templates + + template class MapLS { }; + class String {}; + class X1 { }; + class RefProto { }; + template class Ref { }; + + template <> + class MapLS >: public MapLS { + public: + ~MapLS(); + }; + + MapLS >::~MapLS() { } +
template30.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template13.C =================================================================== --- template13.C (nonexistent) +++ template13.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed templates +template +class ListS { +public: + class Vix { + public: + Vix(); + }; +}; + +template +ListS::Vix::Vix() +{ } +
template13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: delete2.C =================================================================== --- delete2.C (nonexistent) +++ delete2.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do run } +// GROUPS passed operator-delete +// Check that using the delete operator with a null pointer +// is allowed (as called for by The Book, pg. 259) + +extern "C" int printf (const char *, ...); + +struct base { + int member; +}; + +base* bp; + +void test () +{ + delete bp; +} + +int main () +{ + bp = (base *) 0; + test (); + + printf ("PASS\n"); + return 0; +}
delete2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem1.C =================================================================== --- ptrmem1.C (nonexistent) +++ ptrmem1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed pointers-to-members +class my_class +{ +public: + typedef void func_type (int num); + my_class (int num, func_type* proc); + void dispatch (void); +private: + int _num; + func_type *_proc; +}; + +my_class::my_class (int num, func_type* proc) : _num(num), _proc(proc) +{ +} + +void my_class::dispatch (void) +{ + _proc(_num); +}
ptrmem1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash8.C =================================================================== --- crash8.C (nonexistent) +++ crash8.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do compile } +// GROUPS passed old-abort +template +class Elvis // { dg-error "class Elvis" } +{ +} ; + +template +class Elvis<0> // { dg-error "wrong number of template arguments" } +{ + int geta() { return a ; } +} ;
crash8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings10.C =================================================================== --- warnings10.C (nonexistent) +++ warnings10.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed warnings +void foo() +{ + int i; + if (1) { + for (int i = 0; i < 10; i++) + ; + } +}
warnings10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend3.C =================================================================== --- friend3.C (nonexistent) +++ friend3.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed friends +class B { + + friend class A; + + enum { + bEnum = 1, // { dg-error "comma at end" } + }; + + int bArray[ bEnum ]; + +public: + void bFunction(int arg[ bEnum ]); +}; + + +class A { + int aMember; + +public: + void aFunction(int a[B::bEnum]) + { + B b; + b.bArray[ B::bEnum ] = aMember; + } +}; +
friend3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum7.C =================================================================== --- enum7.C (nonexistent) +++ enum7.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed enums +enum color { red, green, blue, orange, brown }; + +struct s { + enum color field:2; // { dg-error "" } too small +};
enum7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest4.C =================================================================== --- nest4.C (nonexistent) +++ nest4.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed nested-classes +class vec { + class blah { }; + + ::vec::blah satan( 0);// { dg-error "" } .* + blah herman( 0);// { dg-error "" } .* +};
nest4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: err-msg5.C =================================================================== --- err-msg5.C (nonexistent) +++ err-msg5.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed error-messages +class foo {}; +~foo () {}// { dg-error "" } destructors must be member functions.*
err-msg5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rtti1.C =================================================================== --- rtti1.C (nonexistent) +++ rtti1.C (revision 816) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed RTTI +#include + +struct B { virtual ~B(){} }; +struct D0 : public virtual B { virtual ~D0(){} }; +struct D1 : public virtual D0 { virtual ~D1(){} }; +struct C : public virtual B, public D1 { virtual ~C() { } };
rtti1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bit-fields1.C =================================================================== --- bit-fields1.C (nonexistent) +++ bit-fields1.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed bit-fields +struct bar { + int : 2 = 1;// { dg-error "" } .* +};
bit-fields1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash41.C =================================================================== --- crash41.C (nonexistent) +++ crash41.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed old-abort +typedef void (**ppfn)(void); + +int main() { + ppfn fn; + + fn = new (void(*)(void)); + + return 0; +}
crash41.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash24.C =================================================================== --- crash24.C (nonexistent) +++ crash24.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// { dg-options "-O" } +// GROUPS passed old-abort +// gcc puts the array into a register, and then the store_bit_field () code +// in expmed.c gets confused when it tries to store zero past the end of the +// register (because the index is past the array bounds). It ends up calling +// store_split_bit_field, which then aborts, because we don't have a split bit +// field. +// +// Seems easiest to detect this case in the front end, i.e. access outside the +// array bounds, and then force the array to be allocated on the stack instead +// of a register. + +main() +{ + char i[1]; + + i[1] = 0; +}
crash24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: code-gen6.C =================================================================== --- code-gen6.C (nonexistent) +++ code-gen6.C (revision 816) @@ -0,0 +1,55 @@ +// { dg-do run } +// GROUPS passed code-generation +// Check that type float parameters can be correctly passed to +// methods. + +extern "C" int printf (const char *, ...); + +class tres_floats { + float ff1; + float ff2; + float ff3; +public: + tres_floats (float f1, float f2, float f3); + float get_f1 (); + float get_f2 (); + float get_f3 (); +}; + +float v1 = 1.2345; +float v2 = 3.14159; +float v3 = 0.707; + +int main () +{ + tres_floats tf (v1, v2, v3); + + if ((tf.get_f1() != v1) || (tf.get_f2() != v2) || (tf.get_f3() != v3)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +} + +tres_floats::tres_floats (float f1, float f2, float f3) +{ + ff1 = f1; + ff2 = f2; + ff3 = f3; +} + +float tres_floats::get_f1 () +{ + return ff1; +} + +float tres_floats::get_f2 () +{ + return ff2; +} + +float tres_floats::get_f3 () +{ + return ff3; +}
code-gen6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: line1.C =================================================================== --- line1.C (nonexistent) +++ line1.C (revision 816) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// GROUPS passed error-messages +typedef struct s S;// { dg-error "" } previous.* +struct S { int member:1; }; // the lineno for this should be 2, not 0// { dg-error "" } conflicting types.*
line1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new1.C =================================================================== --- new1.C (nonexistent) +++ new1.C (revision 816) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// GROUPS passed operator-new +typedef __SIZE_TYPE__ size_t; +struct x { int a; void * operator new (size_t, void *); }; +struct x * f(void *p) { return new (p) x; }
new1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash66.C =================================================================== --- crash66.C (nonexistent) +++ crash66.C (revision 816) @@ -0,0 +1,137 @@ +// { dg-do assemble } +// { dg-options "-O" } +// GROUPS passed old-abort +typedef unsigned char uchar; +typedef unsigned short ushort; +typedef unsigned long ulong; +extern int swap_endian; +inline ushort +swapshort(ushort value) +{ + value &= 0xffff; + return ((value << 8) | (value >> 8)); +} +struct eshort +{ + ushort data; + operator ushort() { return swap_endian ? swapshort(data) : data;} + eshort(ushort t) { data = swap_endian ? swapshort(t) : t;} + eshort() {} +}; +inline ulong +swaplong(ulong value) +{ + ulong v = (value << 16) | (value >> 16); + return ((v >> 8) & 0x00ff00ff) | ((v << 8) & 0xff00ff00); +} +struct elong +{ + ulong data; + operator ulong() { return swap_endian ? swaplong(data) : data;} + elong(ulong t) { data = swap_endian ? swaplong(t) : t; } + elong() {} +}; +struct digiheader +{ + uchar type[2]; + eshort soft_version; + eshort lo_boot_rev; + eshort hi_boot_rev; + eshort load_segment; + eshort length; + eshort exec_start; + eshort image_offset; + elong startup_code[2]; + elong checksum; +}; +extern void uncompress(uchar* buf, ulong len); +extern ulong compress(char* filename, uchar* buffer, ulong); +struct filehdr +{ + eshort f_magic; + eshort f_nscns; + elong f_timdat; + elong f_symptr; + elong f_nsyms; + eshort f_opthdr; + eshort f_flags; +}; +struct aouthdr +{ + eshort magic; + eshort vstamp; + elong tsize; + elong dsize; + elong bsize; + elong entry; + elong text_start; + elong data_start; + elong bss_start; + elong gprmask; + elong cprmask[4]; + elong gp_value; +}; +struct scnhdr +{ + char s_name[8]; + elong s_paddr; + elong s_vaddr; + elong s_size; + elong s_scnptr; + elong s_relptr; + elong s_lnnoptr; + eshort s_nreloc; + eshort s_nlnno; + elong s_flags; +}; +int file_little_endian; +int host_little_endian; +int swap_endian; +int docheck; +int expand; +ulong memsize; +ulong compression_quality; +char *compressfile; +int debug_level; +extern "C" int getopt (int, char**, const char*); +int +main(int argc, char** argv) +{ + uchar checksum; + uchar docrc; + ulong len; + ulong maxlen; + int i; + int c; + int magic; + int tsize; + int dsize; + int quality; + char dummy; + uchar* code; + uchar* buf; + char* ap; + digiheader *dh; + compression_quality = 10000; + docheck = 0; + while ((c = getopt(argc, argv, "Ccdf:k:q:x:")) != -1) + { + switch (c) + { + default: + goto usage; + } + } + if ((expand && (docheck || compressfile || quality)) || + (quality && !compressfile)) + { + usage: + return(2); + } + if (compressfile) + { + dh->image_offset = len; + + len += compress(compressfile, code + len, maxlen - len); + } +}
crash66.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash49.C =================================================================== --- crash49.C (nonexistent) +++ crash49.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed old-abort +#include + +const int keys = 10; +const int key[keys] = {6, key[1], 2, keys, 1, 7, 6, key[2], key[8]}; + +void main() // { dg-error "must return .int" } +{ + for(int i = 0; i < keys;) std::cout << key[i++] << " "; + std::endl(std::cout); +}
crash49.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest15.C =================================================================== --- nest15.C (nonexistent) +++ nest15.C (revision 816) @@ -0,0 +1,37 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +class BDDHeap { +public: + BDDHeap(); + BDDHeap(const BDDHeap&); + + class Page { + public: + int i; + }; + struct Pointer { + Page *page; + unsigned index; + + Pointer(); + Pointer(const BDDHeap& heap); + }; + + struct Half { + struct { + Page *top; + Page **tail; + } inuse; + + Half(); + }; + + Half half[2]; + unsigned halfspace; +}; + +inline +BDDHeap::Pointer::Pointer(const BDDHeap& heap): +page(heap.half[heap.halfspace].inuse.top), +index(0) +{ }
nest15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: alignof.C =================================================================== --- alignof.C (nonexistent) +++ alignof.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed extensions +struct bar { int bit : 1; }; + +void foo (int *r, bar t) +{ + // doing alignof on a bit-field should be illegal + __alignof__ (t.bit);// { dg-error "" } .* + + // both of these (a regular ref and an INDIRECT_REF) should work + __alignof__ (r); + __alignof__ (*r); +}
alignof.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template22.C =================================================================== --- template22.C (nonexistent) +++ template22.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do run } +// GROUPS passed templates +extern "C" int printf (const char *, ...); + +template +class Foo +{ +public: + void func (int const& i); +}; + +template +void Foo:: +func (int const& i) +{} + + +int main () +{ + Foo foo; + printf ("PASS\n"); + return 0; +}
template22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility8.C =================================================================== --- visibility8.C (nonexistent) +++ visibility8.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed visibility +// Make sure private inheritance affects the visibility of +// static members used in an inherited context. +class foo +{ +public: + static int y; // { dg-error "" } private +}; +class foo1 : private foo +{ }; +class foo2 : public foo1 +{ public: + void bar () { y; }// { dg-error "" } .* +};
visibility8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warnings7.C =================================================================== --- warnings7.C (nonexistent) +++ warnings7.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// { dg-options "-O2 -Wall" } +// GROUPS passed warnings +template +class X { +public: + void kill(unsigned i) + { vec[i].~T(); } + T *vec; +}; + +class Y { }; + +void +x() +{ + X x; + x.kill(0); + X y; + y.kill(0); +}
warnings7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl2.C =================================================================== --- redecl2.C (nonexistent) +++ redecl2.C (revision 816) @@ -0,0 +1,52 @@ +// { dg-do run } +// GROUPS passed redeclaration +// Check that if multiple declarations of the same single +// function are present in different places in the same file, +// and if these declarations differ (as allowed) in the number +// of argument defaults provided, that correct values are +// passed at all call points anyway. + +extern "C" int printf (const char *, ...); + +void receiver (int ii, int jj); + +void sender_1 () +{ + receiver (3,7); +} + +void receiver (int ii, int jj = 9); + +void sender_2 () +{ + receiver (5); +} + +int ii_sum = 0; +int jj_sum = 0; + +void sender_3 (); + +int main () +{ + sender_1 (); + sender_2 (); + sender_3 (); + if (ii_sum != 13 || jj_sum != 25) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + + return 0; +} + +void receiver (int ii, int jj) +{ + ii_sum += ii; + jj_sum += jj; +} + +void sender_3 () +{ + receiver (5); +}
redecl2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vtables1.C =================================================================== --- vtables1.C (nonexistent) +++ vtables1.C (revision 816) @@ -0,0 +1,43 @@ +// { dg-do run } +// GROUPS passed virtual-tables +// Check that virtual function tables are generated and used +// even for struct's/classes which have no explicit constructors. + +extern "C" int printf (const char *, ...); + +int base_func_member_1_called = 0; +int derived_func_member_1_called = 0; + +struct base { + virtual void func_member_1 () + { + base_func_member_1_called++; + } +}; + +struct derived : public base { + virtual void func_member_1 () + { + derived_func_member_1_called++; + } + + virtual void func_member_2 () + { + } +}; + +base* bp1; +base* bp2; + +int main () +{ + bp1 = new base; + bp2 = new derived; + + bp1->func_member_1 (); + bp2->func_member_1 (); + + printf ("PASS\n"); + + return 0; +}
vtables1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc7.C =================================================================== --- misc7.C (nonexistent) +++ misc7.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do run } +// GROUPS passed miscellaneous +extern "C" int printf (const char *, ...); + +int main() +{ + int i = 0; + // Make sure build_unary_op correctly computes this. + int *pi = &(++i); + *pi = 4; + + if (i != 4) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
misc7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init1.C =================================================================== --- init1.C (nonexistent) +++ init1.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed initialization + class Thing{ + private: + int x,y; + public: + Thing (int v, int q) { x = v; q = y; } + void doit(int); + }; + + Thing t(18,19);
init1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init9.C =================================================================== --- init9.C (nonexistent) +++ init9.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed initialization +int FALSE = 0; +class X { +public: + static int FALSE; +}; + +// The compiler should NOT complain about redeclaration of the global +// `FALSE' with this declaration...grokvardecl shouldn't be doing that. +int X::FALSE = 0;
init9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum-clash.C =================================================================== --- enum-clash.C (nonexistent) +++ enum-clash.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed arm +enum color {red, yellow, green=20, blue}; +color c = 1; // this should be an error// { dg-error "" } .* +int i = yellow;
enum-clash.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: copy3.C =================================================================== --- copy3.C (nonexistent) +++ copy3.C (revision 816) @@ -0,0 +1,59 @@ +// { dg-do run } +// GROUPS passed copy-ctors +/* + +If I compile it with cfront (AT&T C++ Translator 2.00.02 08/25/89) and run it +I get: + + A::A() + A::A(const A&) + B::Bar() + A::~A() + A::~A() + +If I compile it with g++ (gcc version 2.2.2) and run it I get: + + A::A() + B::Bar() + A::~A() + A::~A() + +*/ +extern "C" int printf (const char *, ...); +extern "C" void exit (int); + +int count = 0; + +void +die (int x) +{ + if (x != ++count) + { + printf ("FAIL\n"); + exit (1); + } +} + + +class A { +public: + A() { die (1); } + A(const A&) { die (2); } + ~A() { count++; if (count != 4 && count != 5) die (-1); } +}; + +class B : public A { +public: + void Bar() { die (3); } +}; + +void Foo(B b) { b.Bar(); } + +int +main() +{ + B b; + Foo(b); + + printf ("PASS\n"); +}
copy3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scope5.C =================================================================== --- scope5.C (nonexistent) +++ scope5.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed scoping +class Integer { +public: + int i; +}; + +class Type { + enum Klasse { ENUM, INTEGER }; + + class Description { + public: + + }; + + class Integer: public Description { + public: + ::Integer low; + ::Integer high; + }; +};
scope5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template4.C =================================================================== --- template4.C (nonexistent) +++ template4.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed templates +// This used to be a circularity in chainon. +template struct TMPL { + typedef int ARG::*ARG_data_member_ptr; + typedef void (ARG::*ARG_func_member_ptr) (); +}; + +struct S { }; + +TMPL object;
template4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload6.C =================================================================== --- overload6.C (nonexistent) +++ overload6.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed overloading +struct temp_string { + temp_string (const unsigned char); +}; + +class String { + public: + String& operator = (temp_string); + String& operator = (const String&); +}; +class S { + public: + operator temp_string & () const; +}; + +S lbuf; + +static void e_r () +{ + String a; + a = lbuf; + return; +}
overload6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: misc17.C =================================================================== --- misc17.C (nonexistent) +++ misc17.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed miscellaneous-bugs +typedef int va_list; +class ostream; +class String { +public: +operator const char *() const; +}; +class FwtErrorManager { +public: + FwtErrorManager(ostream& err, const char *program); +public: + void form(const char *format, ...); +protected: + const String _program; +private: + FwtErrorManager(const FwtErrorManager&); + void operator=(const FwtErrorManager&); +}; +class FwtProgram: public FwtErrorManager { +public: + FwtProgram(); +}; +class FwtArgOptions { }; +class FwtStdProgram: public FwtProgram, public FwtArgOptions { +public: + FwtStdProgram(); + void usage_if_not_complete(); +}; +void +FwtStdProgram::usage_if_not_complete() +{ + FwtStdProgram& thisp = *this; + thisp.form("%s: error, there were unrecognized options", + (char *) FwtErrorManager::_program);// { dg-error "" } .* +}
misc17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash50.C =================================================================== --- crash50.C (nonexistent) +++ crash50.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class B + { +public: + int i; + }; +int operator & (const B &s) { return ( s.i );} + + + + + +class C + { +public: + C &operator = (const C &x) + { + return *this; + }; + }; + +C &(C::*DD)(const C &x) = &C::operator=; + +int main() +{ + ⅅ + +}
crash50.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators8.C =================================================================== --- operators8.C (nonexistent) +++ operators8.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed operators +struct A { + char *p; + operator char *(); +}; + +char foo(A a) +{ + return a[0]; +}
operators8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash33.C =================================================================== --- crash33.C (nonexistent) +++ crash33.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed old-abort +extern void foo(void *); +int +main() { + foo((struct bar *)0); +}
crash33.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash16.C =================================================================== --- crash16.C (nonexistent) +++ crash16.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do compile } +// GROUPS passed old-abort +class Graph { +public: + unsigned char N; + Graph(void) {}; // { dg-error "previously defined here" } +} + +Graph::Graph(void) // { dg-error "return type|redefinition|semicolon" } +{ N = 10; +} +
crash16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum13.C =================================================================== --- enum13.C (nonexistent) +++ enum13.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed enums +enum COLOR { red, green, blue }; + +struct S { + COLOR color:2; +}; + +COLOR color; +S object; + +void fubar () +{ + color = object.color; +}
enum13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors1.C =================================================================== --- ctors1.C (nonexistent) +++ ctors1.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do run } +// GROUPS passed constructors +// Check that global level object constructors get called. + +extern "C" int printf (const char *, ...); + +struct base { + int f1; + int f2; + base (int arg1, int arg2); +}; + + +base global_base(0x55, 0xff); + +int main () +{ + if ((global_base.f1 != 0x55) || (global_base.f2 != 0xff)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +} + +base::base(int arg1, int arg2) +{ + f1 = arg1; + f2 = arg2; +}
ctors1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash58.C =================================================================== --- crash58.C (nonexistent) +++ crash58.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class X { +public: +void doit(); +}; + +X::::doit()// { dg-error "" } (syntax|parse) error.* +{ +}
crash58.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nest24.C =================================================================== --- nest24.C (nonexistent) +++ nest24.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed nested-classes +struct A { + A (){} +}; + +void foo () +{ + struct B {}; + + struct S : B { + A a; + }; +}
nest24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template31.C =================================================================== --- template31.C (nonexistent) +++ template31.C (revision 816) @@ -0,0 +1,38 @@ +// { dg-do assemble } +// GROUPS passed templates +// PRMS Id: 13218 + +struct C { + int x; + char y; + double z; +}; +C c02; + +template struct A { + int* p; + A() : p(ip) {} +}; + +template struct B { + C* p; + B() : p(cp) {} +}; + +int i00; + +int main(void) +{ + A<&i00> a00; + + extern int i01; + A<&i01> a01; + + B<&c02> b02; + + extern C c03; + B<&c03> b03; +} + +int i01; +C c03;
template31.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash1.C =================================================================== --- crash1.C (nonexistent) +++ crash1.C (revision 816) @@ -0,0 +1,44 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class D_Interval; + +class Date +{ + public: + Date(const D_Interval*,const Date&); +private: + const D_Interval* interval; +}; + +class Time_Interval +{ + public: + Time_Interval(const Date& start,const Date& stop); + const Date& Start() const { return start; } + const Date& Stop() const { return stop; } + private: + Date start; + Date stop; +}; + +class Dated_Data +{ + public: + Dated_Data(const Time_Interval& dates); + virtual ~Dated_Data(); + Time_Interval Dates() const { return dates; } + private: + Time_Interval dates; +}; + +class Raw_Data : public Dated_Data +{ + public: + Raw_Data(const Dated_Data *source,const D_Interval& period); +}; + +Raw_Data::Raw_Data(const Dated_Data *source,const D_Interval& period) + : Dated_Data(Time_Interval(Date(&period,source->Dates().Start()), + Date(&period,source->Dates().Stop()))) +{ +}
crash1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth1.C =================================================================== --- synth1.C (nonexistent) +++ synth1.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do assemble { xfail sparc64-*-elf } } +// { dg-options "-pedantic-errors -g -Wall" } +// GROUPS passed synthetics +// Check to make sure that g++ doesn't get freaked out about the use +// of generated methods that it supposedly "can't see". + +class Char { +public: + Char(); + Char(char v); + + // synthetic copy-constructor and operator= +private: + char value; +}; + +class XChar: public Char { +public: + XChar(); + XChar(char v, int serial); + + void operator=(const XChar& other); +private: + int serial; +}; + +void +XChar::operator=(const XChar& other) +{ + Char::operator=(other); + // serial stays the same +}
synth1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ptrmem2.C =================================================================== --- ptrmem2.C (nonexistent) +++ ptrmem2.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed pointers-to-members +struct C { + struct N { + int g1(int); + int g2(int); + }; + + typedef int (N::*pmfn)(int); + + int f1(int); + int f2(int); +}; + +int (C::*f)(int) = &C::f1; + +/* + The compiler should not crash on the line below; this change fixes it: + * cp-tree.c (list_hash_lookup_or_cons): Make sure the type doesn't + have TYPE_PTRMEMFUNC_P set before we try to build its + CLASSTYPE_ID_AS_LIST. +*/ + +C::pmfn h = &C::N::g1; + +int (C::N::*g)(int) = &C::N::g2;
ptrmem2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash9.C =================================================================== --- crash9.C (nonexistent) +++ crash9.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed old-abort +class A {}; + +class SimQuery +{ +public: + SimQuery(); + ~SimQuery(); + int SetMeshFile(char name[]); +protected: + A& scaling; + A* mesh; +}; + +SimQuery::SimQuery():scaling(A) {}// { dg-error "" } .* + +SimQuery::~SimQuery() {} + +int SimQuery::SetMeshFile(char name[]) +{ + mesh = new C;// { dg-error "" } .* + return 0; // needed to avoid warning of reaching end of non-void fn +}
crash9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend4.C =================================================================== --- friend4.C (nonexistent) +++ friend4.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed friends +// do_friend should complain that foo was declared as a friend of +// A before A was defined +struct A; // { dg-error "forward" } +struct B { friend A::foo (); };// { dg-error "" } .*
friend4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum8.C =================================================================== --- enum8.C (nonexistent) +++ enum8.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed enums +class foo1 +{ + public: + enum foo1_enum + { + ENUM1, + ENUM2, // { dg-error "comma at end" } + }; +}; + + +class foo2 +{ + private: + enum foo1::foo1_enum Enum; +}; + + +class foo3 +{ + private: + foo1::foo1_enum Enum; +};
enum8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.