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++.law
    from Rev 154 to Rev 816
    Reverse comparison

Rev 154 → Rev 816

/nest5.C
0,0 → 1,17
// { dg-do assemble }
// GROUPS passed nest
// nest file
// From: tal@vlsi.cs.caltech.edu
// Date: Mon, 11 Oct 93 16:26:02 -0700
// Subject: Serious bug: g++2.4.5 -Doesn't support local classes
// Message-ID: <9310112325.AA13386@vlsi.cs.caltech.edu>
 
void foo() {
class Wrapper {
public:
void F (void * Wrapperptr)
{
Wrapper * wrapptr = ( Wrapper *) Wrapperptr;
}
};
}
nest5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt17.C =================================================================== --- cvt17.C (nonexistent) +++ cvt17.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9305210124.AA02409@kato.cs.brown.edu> +// From: pcm@cs.brown.edu (Peter C. McCluskey) +// Subject: illegal code compiles silently +// Date: Thu, 20 May 93 21:24:22 -0400 + + + +class Point {}; +class Line_Segment{ public: Line_Segment(const Point&){} }; +class Node { public: Point Location(){ Point p; return p; } }; + +int main() +{ + Node** node1; + Line_Segment(node1->Location()); // intended (*node1)// { dg-error "" } .* +} +
cvt17.C Property changes : Added: svn:eol-style ## -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,43 @@ +// { dg-do run } +// GROUPS passed bit-fields +// bitfield file +// Message-Id: <92Oct29.191913est.62@jarvis.csri.toronto.edu> +// From: mdivax1!robinson@ai.mit.edu (Jim Robinson) +// Subject: gcc 2.2.2 C++ bug in handling :0 bit fields +// Date: Thu, 29 Oct 1992 19:18:28 -0500 +// +// Also applies to: +// bitfield file +// From: Jaimie Wilson/MSL +// Date: Fri, 28 Jan 1994 06:11:43 -0500 +// Subject: GCC bug report +// +// This test is only meant for targets where EMPTY_FIELD_BOUNDARY is +// defined to no larger than the size of an unsigned int, or where +// PCC_BITFIELD_TYPE_MATTERS is defined. Add skips below for targets that +// do not have that property. +// { dg-skip-if "" { mmix-knuth-mmixware } { "*" } { "" } } + + +#include +#include + +struct foo { + char a; + char b; + unsigned int : 0; /* force word alignment */ + char c; +}; + +int +main(int argc, char **argv) +{ + struct foo bar; + + if (offsetof (struct foo, c) > sizeof (unsigned int)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + return 0; +} +
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: visibility1.C =================================================================== --- visibility1.C (nonexistent) +++ visibility1.C (revision 816) @@ -0,0 +1,68 @@ +// { dg-do assemble } +// GROUPS passed visibility +#include + + + +class base { +//========== + + void base_priv(const char * n) + { std::cout << "base_priv called from: " << n << "\n"; }; + +protected: + + void base_prot(const char * n) + { std::cout << "base_prot called from: " << n << "\n"; }; + +public: + + void base_publ(const char * n) + { std::cout << "base_publ called from: " << n << "\n"; }; + + void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); } + +}; // class base + + + +class derived : private base { // Make this public, +//============================ // and we don't get an error + +friend void derived_friend(); + +public : + + void test(const char * n) { base_publ(n); base_prot(n);} + +}; // class derived + + + +void +derived_friend() +//-------------- +{ + derived pd; + + pd.base_publ("friend of derived class"); // Compiler error here + pd.base_prot("friend of derived class"); +} + + + +int main(int argc, char *argv[]) +//========================== +{ + base b; + b.base_publ("base class object"); + b.test("member of base class object"); + std::cout << "\n"; + + derived pd; + pd.test("member of derived class object"); + derived_friend(); + std::cout << "\n"; + +} /* main */ +
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: except1.C =================================================================== --- except1.C (nonexistent) +++ except1.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// { dg-options "-fexceptions" } +// GROUPS passed exceptions +// except file +// Message-Id: <9207221230.AA08566@life.ai.mit.edu> +// From: EWALLACE@endvmtkl.vnet.ibm.com +// Subject: Bugs +// Date: Wed, 22 Jul 92 08:29:30 EDT + +extern "C" void puts(const char *); + +class foo { +public: + class error {}; + + void cause_error(void) { throw error(); } +}; + +int main(void) +{ + foo f; + try { + f.cause_error(); + } + catch (foo::error) { + puts("Caught it."); + } + return 0; +}
except1.C Property changes : Added: svn:eol-style ## -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,29 @@ +// { dg-do assemble } +// GROUPS passed unions +// anon-union file +// From: "Terry R. Coley" +// Date: Tue, 25 Aug 1992 17:33:29 -0700 +// Subject: possible bug in gcc/g++ +// Message-ID: <199208260033.AA19417@brahms.wag.caltech.edu> + +typedef enum { BADBINOP = 0, PLUS, MINUS, MULT, DIV, POWR } binoptype; +typedef enum { BADUNOP = 0, NEG = POWR+1, SIN, COS, TAN } unoptype; + +typedef struct { + const char *s; + union { + binoptype bop; + unoptype uop; + }; +} +op_to_charp; + +op_to_charp BINOPS[] = { {"+", PLUS}, + {"-", MINUS}, + {"*", MULT}, + {"/", DIV}, + {"^", POWR} }; + +int main() { + int dummy; +}
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: temps4.C =================================================================== --- temps4.C (nonexistent) +++ temps4.C (revision 816) @@ -0,0 +1,40 @@ +// { dg-do run } +// { dg-options "-felide-constructors" } +// GROUPS passed temps +// temps file +// Message-Id: <9311102043.AA22871@ses.com> +// From: jamshid@ses.com (Jamshid Afshar) +// Subject: elide-constructors (aka return value optimization) +// Date: Wed, 10 Nov 93 14:43:54 CST + +#include +#include + +class X { + int i; + public: + X(); + X(const X&); + X(int); + ~X(); +}; + +int did_it = 0; + +X::X() { ; } +X::X(const X&) { did_it = 1; } +X::X(int) { ; } +X::~X() { ; } + +X foo() { + X x(1); + return x; +} + +main() { + X x = foo(); + if (did_it) + abort (); + else + printf ("PASS\n"); +}
temps4.C Property changes : Added: svn:eol-style ## -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,22 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// rom: roland@jts.com (Roland Knight ) +// Date: Sat, 8 May 1993 17:27:35 -0400 +// Subject: gcc 2.3.3 protected member access bug +// Message-ID: <9305082127.AA19577@icepick.jts.com> + +class A { +protected: + int a; // { dg-error "" } protected +}; + +class B : public A { +public: + void f1(A* pa); +}; + + +void B::f1(A* pa) { + pa->a = 1; // illegal but allowed by gcc// { 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: typeck2.C =================================================================== --- typeck2.C (nonexistent) +++ typeck2.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed typeck +// typeck file +// From: Jutta Degener +// Date: Wed, 9 Jun 1993 17:58:35 +0200 (MET DST) +// Subject: 2.4.3: Type of new +// Message-ID: <199306091558.AA19075@mail.cs.tu-berlin.de> + + typedef int arr[10]; +int main() + { + int * p = new int[10]; + int * q = new arr; /* g++ complains, but shouldn't */ + int (* r)[10] = new arr; /* g++ doesn't complain, but should */// { dg-error "" } + } +
typeck2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt8.C =================================================================== --- cvt8.C (nonexistent) +++ cvt8.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// From: solomon@cs.wisc.edu (Marvin Solomon) +// Message-Id: <9209141509.AA23124@gjetost.cs.wisc.edu> +// Subject: g++ 2.2.2 seems to be forgetting a "const" +// Date: Mon, 14 Sep 92 10:09:58 -0500 + +extern "C" int printf (const char *, ...); + +struct A { + int i; +}; + +struct B { + int i; + operator const A&() const; +}; + +B::operator const A&() const { + static A a; + a.i = i; + printf("convert B to A at %x\n", &a); + return a; +} + +void f(A &a) { // { dg-error "" } in passing argument + printf("A at %x is %d\n", &a, a.i); +} + +int main() { + B b; + b.i = 99; + f(b);// { dg-error "" } .* +}
cvt8.C Property changes : Added: svn:eol-style ## -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,9 @@ +// { dg-do assemble } +// GROUPS passed initialization +// init file +// From: lupine!segfault!rfg@uunet.UU.NET +// Date: Sun, 27 Sep 92 14:06:22 MDT +// Subject: Bug in g++ (920220) handling reference initializers. +// Message-ID: <15409.717627982@segfault> + +int * const & fiddle = 0;
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: operators34.C =================================================================== --- operators34.C (nonexistent) +++ operators34.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed operators +class A { + public: + A() { + } +}; + +static class A *A_new_() { + return new class A; +} +
operators34.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing2.C =================================================================== --- parsing2.C (nonexistent) +++ parsing2.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: jonathan@Pescadero.Stanford.EDU +// Date: Tue, 15 Sep 92 14:15:29 PDT +// Subject: Function taking as argument a pointer to a pointer to a function +// that returns int causes coredump in cc1plus +// Message-ID: <9209152115.AA07423@Pescadero.Stanford.EDU> + + unsigned char FindMdc ( int (**)() ); + unsigned char FindMdc2 ( int (**funcname)() );
parsing2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators17.C =================================================================== --- operators17.C (nonexistent) +++ operators17.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// { dg-options "-Wall -pedantic-errors" } +// GROUPS passed operators +// copy file +// From: gfm@mencon.mencon.oz.au (Graham Menhennitt) +// Date: Thu, 29 Apr 93 20:53:07 EST +// Subject: 4 bugs in g++ 2.3.3 +// Message-ID: <9304291053.AA00090@mencon> + +struct A { + A& operator = (const A& a) {}// { dg-warning "" } +};
operators17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg1.C =================================================================== --- arg1.C (nonexistent) +++ arg1.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// Subject: argument matching depending on the def order +// From: kondo@akane.mech.ibaraki.ac.jp +// Date: Fri, 04 Sep 92 17:41:05 JST + +#include +// check the order of declarations +class A { +public: + void f(double* p) { std::cout << "A(double*)\n"; } // { dg-error "" } candidate + void f(int* p) { std::cout << "A(int*)\n"; } // { dg-error "" } candidate +}; + +class B { +public: + void f(int* p) { std::cout << "B(int*)\n"; } // { dg-error "" } candidate + void f(double* p) { std::cout << "B(double*)\n"; } // { dg-error "" } candidate +}; + +int main() +{ + A a; + B b; + + a.f(0);// { dg-error "" } .* + b.f(0);// { dg-error "" } .* +} +
arg1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility13.C =================================================================== --- visibility13.C (nonexistent) +++ visibility13.C (revision 816) @@ -0,0 +1,110 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: dinh@cs.ucla.edu (Dinh Le) +// Date: Mon, 12 Jul 93 22:21:06 -0700 +// Subject: class, template and their scoping problem +// Message-ID: <9307130521.AA18312@oahu.cs.ucla.edu> + +#include +#include + +// --------------- Array.h && Array.cc ------------------ + +using namespace std; + +const int ArraySize = 12; + +template +class Array { // { dg-error "" } .struct Array_RC redecl.* +friend class Array_RC; +public: + Array(const Type *ar, int sz) { init(ar,sz); } + virtual ~Array() { delete [] ia; } + virtual void print(ostream& = cout); + virtual Type& operator[](int ix) { return ia[ix]; } +private: + void init(const Type*, int); + int size; + int *ia; +}; + +template +ostream& operator<<( ostream& os, Array& ar ) +{ + ar.print(os); + return os; +} + +template +void Array::print(ostream& os) +{ + const int lineLength = 12; + + os << "( " << size << " )< "; + for (int ix = 0; ix < size; ++ix) { + if (ix % lineLength == 0 && ix) os << "\n\t"; + os << ia[ ix ]; + + if (ix % lineLength != lineLength-1 && + ix != size-1) + os << ", "; + } + os << " >\n"; +} + +template +void Array::init(const Type *array, int sz) +{ + ia = new Type[size = sz]; + + for (int ix = 0; ix < size; ++ix) + ia[ix] = (array!=0) ? array[ix] : (Type)0; +} + +// --------------- Array_RC.h && Array_RC.cc ---------------- + +template +class Array_RC : public Array { +public: + Array_RC(const Type *ar, int sz); + Type& operator[](int ix); +}; + +template +Array_RC::Array_RC(const Type *ar, int sz) : Array(ar, sz) {} + +template +Type &Array_RC::operator[](int ix) { + assert(ix >= 0 && ix < size);// { dg-error "" } member .size.* + return ia[ix];// { dg-error "" } member .ia.* +} + +// ------------------- Test routine ---------------------- + +template +void try_array( Array &iA ) +{ + cout << "try_array: initial array values:\n"; + cout << iA << endl; +} + +template +inline void +try_array( Array_RC &rc ) +{ + try_array( ((Array&)rc) ); +} + +int main() +{ + static int ia[10] = { 12, 7, 14, 9, 128, 17, 6, 3, 27, 5 }; + Array_RC iA(ia, 10); + + cout << "template Array_RC class" << endl; + try_array(iA); + + return 0; +} + +template class Array_RC;
visibility13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors12.C =================================================================== --- ctors12.C (nonexistent) +++ ctors12.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do run } +// GROUPS passed constructors +#include +#include +#include + +#define MAGIC 7654 + +class complex { + double re; + double im; + int magic; + static int count; +public: + complex() { re=im=0; magic=MAGIC; } + complex(double d) { re=d; im=0; magic=MAGIC; } + complex(double d, double d2) {re=d; im=d2; magic=MAGIC; } + ~complex() {if(magic!=MAGIC) {std::printf("FAIL\n"); std::exit(1);}} + friend std::ostream& operator << (std::ostream& o, const complex& c) + { return o << "(" << c.re << "," << c.im << ")"; } +}; + +int complex::count=0; + +int main() +{ + complex v[6] = {1, complex(1,2), complex(), 2 }; // ARM Sect. 12.6.1 + int i; // page 289 + + for(i=0; i<6; i++) ; + std::printf ("PASS\n"); + + return 0; +}
ctors12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg9.C =================================================================== --- arg9.C (nonexistent) +++ arg9.C (revision 816) @@ -0,0 +1,39 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <199405132049.QAA06835@elan.cs.UMD.EDU> +// Subject: Bug in g++ 2.4.5 and 2.5.8 +// Date: Fri, 13 May 1994 16:49:22 -0400 +// From: Evan Rosser + +#include +#include +#include + +class TupleIterator { +public: + TupleIterator(int *tpl); + int& operator*(); + int live() const; +// The compile fails with "no post-increment operator for type" at "TI++" +// below. +// It succeeds with the same declarations if set_position does not take an int. +// This occurs with G++ 2.4.5 and 2.5.8. +// Sun CC works OK with either case. + void operator++(int); + void set_position(int); +private: +}; + +int main() { + +int t[5]; +t[1] = 1; t[2] = 2;t[3] = 3;t[4] = 4; +TupleIterator TI(t); + + while(TI.live()){ + printf("%d", *TI); + TI++; + } +} +
arg9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators9.C =================================================================== --- operators9.C (nonexistent) +++ operators9.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-eq file +// Message-Id: <9301141514.AA05925@mi.el.utwente.nl> +// From: klamer@mi.el.utwente.nl (Klamer Schutte) +// Subject: 2.3.3: failed to detect error +// Date: Thu, 14 Jan 93 16:14:21 +0100 + +class B +{ +public: + operator=(B &); // { dg-error "" } no type or storage class +}; + +void +test(B &b1, const B &b2) +{ + b1 = b2;// { dg-error "" } .* +}
operators9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm8.C =================================================================== --- arm8.C (nonexistent) +++ arm8.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <9303161105.AA29336@slsvitt> +// From: dcb@us-es.sel.de (David Binderman 3841) +// Subject: Page 141 of the ARM +// Date: Tue, 16 Mar 93 12:05:24 +0100 + +struct K { + void f( int *p = 0); // { dg-error "" } previous specification +}; + +extern int * q; + +void K::f( int *p = q);// { dg-error "" } .* +
arm8.C Property changes : Added: svn:eol-style ## -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,70 @@ +// { dg-do run } +// GROUPS passed constructors +// Message-Id: +// Date: Fri, 10 Dec 93 11:33 EST +// From: neal@ctd.comsat.com (Neal Becker) +// Subject: serious problems with static constructors + +#include +#include +#include + +#define CONST const + +class Sig { + +public: + + enum Type { Byte_t, Word_t, Long_t, Float_t, Double_t, Complex_t, ComplexLong_t, Bad_t }; + +private: + + Type T; + +public: + + static CONST char *ByteMagic, *WordMagic, *LongMagic, + *FloatMagic, *DoubleMagic, *ComplexMagic, *ComplexLongMagic, *BadMagic; + + struct SigTable { + Type T; + CONST char* Magic; + }; + + static CONST SigTable sigTable[]; + +}; + +CONST char +*Sig::ByteMagic = "BYTE", +*Sig::WordMagic = "WORD", +*Sig::LongMagic = "LONG", +*Sig::FloatMagic = "FLOA", +*Sig::DoubleMagic = "DOUB", +*Sig::ComplexMagic = "COMP", +*Sig::ComplexLongMagic = "CMPL", +*Sig::BadMagic = NULL; + + +CONST Sig::SigTable Sig::sigTable[] = { + { Byte_t, ByteMagic }, + { Word_t, WordMagic }, + { Long_t, LongMagic }, + { Float_t, FloatMagic }, + { Double_t, DoubleMagic }, + { Complex_t, ComplexMagic }, + { ComplexLong_t, ComplexLongMagic }, + { Bad_t, BadMagic } +}; + +int main() { + if (strcmp (Sig::sigTable[0].Magic, "BYTE") + || strcmp (Sig::sigTable[1].Magic, "WORD") + || strcmp (Sig::sigTable[2].Magic, "LONG") + || strcmp (Sig::sigTable[3].Magic, "FLOA") + || strcmp (Sig::sigTable[4].Magic, "DOUB") + || strcmp (Sig::sigTable[5].Magic, "COMP")) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
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: unsorted1.C =================================================================== --- unsorted1.C (nonexistent) +++ unsorted1.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// { dg-options "-O" } +// GROUPS passed unsorted +// unsorted.2 file +// From: skipnyc!skipsun!skip@fsg.com (Skip Gilbrech) +// Date: Wed, 10 Jun 92 6:55:18 EDT +// Subject: Problem with derived class access adjustment and -O +// Message-ID: <9206101055.AA20593@skipsun.UUCP> + + +class A { + public: + virtual void func() = 0; +}; + +class B : public A { + public: + void func() {} +}; + +class C : private B { + public: + B::func; +}; + +class D { + C c; + public: + void func() { c.func(); } +}; +
unsorted1.C Property changes : Added: svn:eol-style ## -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 X { + struct X1; + enum { A= sizeof(X1 *) }; //Causes a problem. + struct X1 { int i; }; + X1 *f(X1 *); +public: + X(void); +}; + +X::X1 *X::f(X1 *x) { + return x; +}
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: arm16.C =================================================================== --- arm16.C (nonexistent) +++ arm16.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "-ansi -Wall -pedantic" } +// GROUPS passed ARM-compliance +// arm file +// From: Olaf.Weber@cwi.nl +// Date: Fri, 2 Dec 1994 09:14:25 +0100 +// Subject: Omitting & when obtaining a pointer to member function. +// Message-ID: <9412020814.AA00604=olaf@havik.cwi.nl> + +struct C { + void foo(); +}; + +void (C::*pfm)() = C::foo;// { dg-error "" } .*
arm16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static-mem5.C =================================================================== --- static-mem5.C (nonexistent) +++ static-mem5.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// { dg-options "-w -fpermissive" } +// GROUPS passed static-mem +// static-mem file +// From: bunch@tazboy.jpl.nasa.gov (Walt Bunch) +// Date: Thu, 23 Jun 94 14:58:35 UNI +// Subject: bug report +// Message-ID: <9406232258.AA03897@tazboy.JPL.NASA.GOV> + + +class A +{ +public: + static void F (int i) {} + static void A::G (int i) {} +}; + +main () +{ + A::F (17); + A::G (42); +} +
static-mem5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility22.C =================================================================== --- visibility22.C (nonexistent) +++ visibility22.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Robert Carden +// Date: Thu, 12 Aug 1993 13:48:05 -0700 +// Subject: bug 8/12/93 -- #5 +// Message-ID: <9308121348.aa26256@Paris.ics.uci.edu> + +// 5.cc +#include + +class A { + int x; +public: + void f(int); + void f(float); + void g(void *); +}; + +class B : private A { +protected: + A::f; +public: + A::g; +};
visibility22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend5.C =================================================================== --- friend5.C (nonexistent) +++ friend5.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// { dg-options "-Wreturn-type" } +// GROUPS passed friends + + extern "C" int good_friend(int); + extern "C" int bad_friend(); + + class assembler { + friend int good_friend(int); + friend int bad_friend(); + void *parts; + }; + + assembler obj; + + int good_friend(int) + { + obj.parts = 0; + } // { dg-error "" } non-void + + int bad_friend() + { + obj.parts = 0; + } // { dg-error "" } non-void +
friend5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors21.C =================================================================== --- ctors21.C (nonexistent) +++ ctors21.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// From: mln@tera.com (Mark Niehaus) +// Subject: g++-2.5.2 -- private copy ctor hides public ctor +// Date: Mon, 8 Nov 93 10:14:50 PST + +class A { + A(A&); + public: + A(); +}; + +class B { + A a; +};
ctors21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt10.C =================================================================== --- cvt10.C (nonexistent) +++ cvt10.C (revision 816) @@ -0,0 +1,60 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: +// From: tom@izfcs.izf.tno.nl (Tom Vijlbrief) +// Subject: g++ 2.4.5 has problems with NON virtual shared base classes +// Date: Mon, 23 Aug 1993 12:10:34 GMT + + +#include + +#define FAIL + +class Base { +public: + Base() { printf("Base::Base\n"); } + virtual ~Base() { printf("Base::~Base\n"); } + virtual void v() { printf("Base::v\n"); } +}; + +class Base2 { +public: + Base2() { printf("Base2::Base2\n"); } + virtual ~Base2() { printf("Base2::~Base2\n"); } + virtual void v() { printf("Base2::v\n"); } +}; + +class A: public Base { +public: + A() { printf("A::A\n"); } + ~A() { printf("A::~A\n"); } + virtual void va() { printf("A::va\n"); } +}; + +#ifdef FAIL +class B: public Base { +#else +class B: public Base2 { +#endif +public: + B() { printf("B::B\n"); } + ~B() { printf("B::~B\n"); } + virtual void vb() { printf("B::vb\n"); } +}; + +class C: public A, public B { +public: + C() { printf("C::C\n"); } + ~C() { printf("C::~C\n"); } + void va() { printf("C::va\n"); } +}; + + +int main() +{ + C *cp= new C; + cp->va(); + delete cp; +} +
cvt10.C Property changes : Added: svn:eol-style ## -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 run } +// { dg-options "-fshort-enums" } +// GROUPS passed enums + extern "C" int printf (const char *, ...); + + enum E { A = 0x80000000, B = 0 }; + + main() + { + if (sizeof (E) != 4) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + return 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,32 @@ +// { dg-do run } +// GROUPS passed arrays +// array file +// Message-Id: <9204120353.AA06266@cs.rice.edu> +// From: dougm@cs.rice.edu (Doug Moore) +// Subject: constructors not called on new'ed array elements +// Date: Sat, 11 Apr 92 22:53:35 CDT + +#include + +int i = 0; + +class foo +{ +private: + static foo *array; +public: + foo() + { + i++; + } +}; + +foo* foo::array = new foo [5]; + +int main() +{ + if (i != 5) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
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: bad-error6.C =================================================================== --- bad-error6.C (nonexistent) +++ bad-error6.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed bad-errors +typedef __SIZE_TYPE__ size_t; + +class tt { + public: + tt(int); + + private: + void *operator new(size_t a); // Forbid object creation in heap memory. +}; + +void st(const tt&, int); + +void ff(int i, int j) +{ + if( i > 0 ) { + // This work ok. + tt a_tt(i); + st(a_tt, j); + } + else { + // This triggers an error because of private operator new ????. + st(tt(-i), j); + } +}
bad-error6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt18.C =================================================================== --- cvt18.C (nonexistent) +++ cvt18.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9307090042.AA28565@uluru.Stanford.EDU> +// From: interran@uluru.stanford.edu (John Interrante) +// Subject: gcc 2.4.5 on sparc-sun-sunos4.1.2: automatic conversion functions +// Date: Thu, 8 Jul 93 17:42:12 PDT + +class Token { +public: + operator const void*() const; + int operator !=(int code) const; +private: + int code_; +}; + +extern Token next_token(); + +void foo(Token token) { + if (token && token != '{') {} + + const int inside_body = 1; + if (inside_body && (token = next_token())) {} +}
cvt18.C Property changes : Added: svn:eol-style ## -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-fields3.C =================================================================== --- bit-fields3.C (nonexistent) +++ bit-fields3.C (revision 816) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// GROUPS passed bit-fields + class t { + short :(sizeof(short)-2); + public: + t(); + };
bit-fields3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual1.C =================================================================== --- virtual1.C (nonexistent) +++ virtual1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// { dg-options "-Woverloaded-virtual" } +// GROUPS passed virtual-warnings +// copy file +// From: gfm@mencon.mencon.oz.au (Graham Menhennitt) +// Date: Thu, 29 Apr 93 20:53:07 EST +// Subject: 4 bugs in g++ 2.3.3 +// Message-ID: <9304291053.AA00090@mencon> + + struct A { + virtual ~A(void); + }; + + struct B { + friend class A; + virtual void f(void); + }; + + struct C : public A { + virtual void f(void); + };
virtual1.C Property changes : Added: svn:eol-style ## -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,68 @@ +// { dg-do assemble } +// GROUPS passed visibility +#include + + + +class base { +//========== + + void base_priv(const char * n) + { std::cout << "base_priv called from: " << n << "\n"; }; + +protected: + + void base_prot(const char * n) + { std::cout << "base_prot called from: " << n << "\n"; }; + +public: + + void base_publ(const char * n) + { std::cout << "base_publ called from: " << n << "\n"; }; + + void test(const char * n) { base_publ(n); base_prot(n); base_priv(n); } + +}; // class base + + + +class derived : public base { // Make this public, +//============================ // and we don't get an error + +friend void derived_friend(); + +public : + + void test(const char * n) { base_publ(n); base_prot(n);} + +}; // class derived + + + +void +derived_friend() +//-------------- +{ + derived pd; + + pd.base_publ("friend of derived class"); // Compiler error here + pd.base_prot("friend of derived class"); +} + + + +int main(int argc, char *argv[]) +//========================== +{ + base b; + b.base_publ("base class object"); + b.test("member of base class object"); + std::cout << "\n"; + + derived pd; + pd.test("member of derived class object"); + derived_friend(); + std::cout << "\n"; + +} /* main */ +
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: except2.C =================================================================== --- except2.C (nonexistent) +++ except2.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-fexceptions -g" } +// GROUPS passed exceptions +// except file +// Message-Id: <9211061330.AA29334@ifad.dk> +// From: erik@ifad.dk (Erik Toubro Nielsen) +// Subject: g++-2.3.1 gets fatal signal with -g and -fhandle-exceptions +// Date: Fri, 6 Nov 92 14:30:33 +0100 + +int main() +{ + return 0; +}
except2.C Property changes : Added: svn:eol-style ## -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,25 @@ +// { dg-do assemble } +// GROUPS passed unions +// anon-union file +// From: gerlek@dat.cse.ogi.edu (Michael Gerlek) +// Date: Tue, 8 Dec 92 12:56 PST +// Subject: private anonymous unions have public members? (gcc-2.3.1) +// Message-ID: + +class A { +public: + int x; +private: + int y; // { dg-error "" } private + union { + int z; // { dg-error "" } private + }; +}; + +void f() { + A a; + + a.x = 0; + a.y = 1;// { dg-error "" } .* + a.z = 2;// { dg-error "" } +}
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: cvt1.C =================================================================== --- cvt1.C (nonexistent) +++ cvt1.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// From: dak@pool.informatik.rwth-aachen.de +// Date: Sun, 21 Nov 93 17:40:32 +0100 +// Subject: g++ mixes up array dimensions with new +// Message-ID: <9311211640.AA11787@messua> + +int main() +{ + int (*a)[5] = new int[6][5]; +}
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: temps5.C =================================================================== --- temps5.C (nonexistent) +++ temps5.C (revision 816) @@ -0,0 +1,42 @@ +// { dg-do run } +// GROUPS passed temps +// temps file +// Message-Id: <9311171029.AA00592@mencon> +// From: gfm@mencon.mencon.oz.au (Graham Menhennitt) +// Subject: gcc 2.5.3 - bug deleting object that is still referred to +// Date: Wed, 17 Nov 93 21:29:23 EST + +#include + +class C { +public: + C(int i) : val(i) { ; } + C(const C& c) : val(c.val) { ; } + ~C(void) { val = 999; } + C& operator = (const C& c) { val = c.val; return *this; } + + C& inc(int i) { val += i; return *this; } + + int val; +}; + +C +f(void) +{ + return C(3); +} + +C +f(int i) +{ + return f().inc(i); +} + +int +main(void) +{ + if (f (2).val != 5) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
temps5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators10.C =================================================================== --- operators10.C (nonexistent) +++ operators10.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-eq file +// Message-Id: <9306040324.AA22954@balder.cs.wisc.edu> +// From: so@cs.wisc.edu (Bryan So) +// Subject: g++ bug +// Date: Thu, 3 Jun 93 22:24:13 -0500 + +template +struct Test { + int data; + Test& operator=(int i) { data = i; return *this; } +}; + + +int main() +{ + Test i, j; + + i = j; + + return 0; +}
operators10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeck3.C =================================================================== --- typeck3.C (nonexistent) +++ typeck3.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed typeck +// typeck file +// From: Dror Caspi +// Date: Wed, 9 Jun 1993 17:43:48 +0300 +// Subject: function typedefs in classes +// Message-ID: <199306091443.AA03735@zorba.fibronics.co.il> + +class a +{ + public: + typedef void (X)(); + + X x; // Member function of type X +}; + +class b +{ + public: + typedef void (X)(); //!!!!!! g++ says : syntax error before `;' + + X x; // Member function of type X +};
typeck3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt9.C =================================================================== --- cvt9.C (nonexistent) +++ cvt9.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed conversions +// cvt file +// Message-Id: +// From: joe@veritas.com (Joe Fasano) +// Subject: gcc-2.2.2 bug report +// Date: Thu, 17 Sep 92 13:27 PDT + +typedef int (*widget) (); + +class window { +public: + int Isopen (); +}; + +widget fp = (widget) &window::Isopen; // { dg-error "" } // ERROR -
cvt9.C Property changes : Added: svn:eol-style ## -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,12 @@ +// { dg-do assemble } +// GROUPS passed initialization +// init file +// From: thayer@moose.cs.columbia.edu (Charles Thayer) +// Date: Wed, 30 Sep 92 02:38:17 EDT +// Subject: small bug +// Message-ID: <9209300638.AA22334@moose.cs.columbia.edu> + +int main() { +int offset; +char buf[offset]=""; // { dg-error "" } ansi forbids variable arrays +}
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: parsing3.C =================================================================== --- parsing3.C (nonexistent) +++ parsing3.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: tll@cco.caltech.edu (Tal Lewis Lancaster) +// Date: 18 Mar 1993 17:09:43 GMT +// Subject: Re: unexpected difference between gcc and g++ (both 2.3.3) +// Message-ID: <1oaacnINNt20@gap.caltech.edu> + +/* Notice that this case parses fine */ +int (* volatile y)[10]; + +void foo2() { + /* The parser can't handle it now */ + int (* volatile x)[10]; +}
parsing3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators18.C =================================================================== --- operators18.C (nonexistent) +++ operators18.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-ampr file +// From: mecklen@oops.cs.utah.edu (Robert Mecklenburg) +// Date: Thu, 8 Oct 92 16:33:08 -0600 +// Subject: Type conversion and overloading bugs in 2.2.2 +// Message-ID: <9210082233.AA28203@hellgate.utah.edu> + + enum E { a, b, c }; + struct Estr { + E value; + Estr() {} + Estr( int i ) : value( (E)i ) {} + operator E() { return value; } + }; + extern Estr baz(); + int bazz() { return baz() & 2; }
operators18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg2.C =================================================================== --- arg2.C (nonexistent) +++ arg2.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <199303032114.AA03574@kolvir.Boulder.ParcPlace.COM> +// From: Warner Losh +// Subject: Overloading bug in g++ 2.3.3 (sparc) compiled by GNU C version 2.3.3 +// Date: Wed, 03 Mar 1993 14:14:02 MST + +class c1 { }; + +typedef void (*fnp)(void *); +typedef void (c1::*memfnp)(void *); +extern void fn1( fnp ); +extern void fn1( c1*, memfnp ); + +void f3(void *) { } + +void fn2() +{ + fn1((fnp) &f3); // Everybody likes this + fn1(&f3); // g++ complains here line 13 +}
arg2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility14.C =================================================================== --- visibility14.C (nonexistent) +++ visibility14.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: ajp@eng.cam.ac.uk +// Date: Tue, 13 Jul 93 17:15:11 BST +// Message-ID: <1171.9307131615@ace.eng.cam.ac.uk + +class A { + static A* list; + + protected: + struct AA { + AA(); + ~AA(); + }; +}; + +A::AA::~AA() +{ + A* d=list; +}
visibility14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors13.C =================================================================== --- ctors13.C (nonexistent) +++ ctors13.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed constructors +#include + +class A { + A() {} // private constructor// { dg-error "" } .* +}; + +int main() { + A* a = new A();// { dg-error "" } .* + if (a) { + std::cout << "a != NULL\n"; + } else { + std::cout << "a == NULL\n"; + } +} + +
ctors13.C Property changes : Added: svn:eol-style ## -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,21 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <9211191128.AA14718@us-es.sel.de> +// From: dcb@us-es.sel.de +// Subject: ARM p79 trivial bug +// Date: Thu, 19 Nov 92 12:28:24 +0100 + +extern "C" int printf( const char *, ...); + +int main() +{ + int a = 1 ; + int b = 2 ; + int c = 3 ; + + (a = b) = c ; + printf( " %d %d %d\n", a, b, c); + return 0 ; +} +
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,15 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-conv file +// Message-Id: <199301260142.AA13995@world.std.com> +// From: gparker@world.std.com (Glenn P Parker) +// Subject: gcc bug +// Date: Mon, 25 Jan 1993 20:42:35 -0500 + +int main(void) +{ + int i = int(); // g++ 2.3.3 cannot compile it. + + return 0; +} +
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: arm9.C =================================================================== --- arm9.C (nonexistent) +++ arm9.C (revision 816) @@ -0,0 +1,38 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +#include +enum f1 { + F1 +}; + +enum f2 { + F2 +}; + +class A { +public: + void set (f1 f); +}; +void A::set (f1 f) { std::cout << "called A f1\n";} + +class B : public A { +public: + void set (f2 f); +}; +void B::set (f2 f) { std::cout << "called B\n";} // { dg-error "" } candidate + +int main() { + B b; + b.set(F1); // ARM page 309: should call A.set(f1) and that what g++ does,// { dg-error "" } .* + // but 13.1 of ARM clearly states that it should call B::set() + // or generate an error because overloading works only for + // functions within the same scope (first page of chapter 13) + // while member of derived and base classes are considered to + // belong to different scopes. Thus B::set() should have + // hidden (completely) the A::set() function. +} + + + + +
arm9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pr25000.C =================================================================== --- pr25000.C (nonexistent) +++ pr25000.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do compile } +// { dg-options "-O2" } +int * f(void); +void g(int*); +bool h(void); +void Find( ) +{ + int * pRes = f(); + if( !pRes ) { + if( h()){ + if( h()){ + try + { + pRes = new int(); + f(); + }catch(int& e1 ){} + } + if( !pRes ) + f(); + } + g(pRes); + } +} +
pr25000.C Property changes : Added: svn:eol-style ## -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,29 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: +// From: genehi@nesmith.pactitle.com (Gene Hightower) +// Subject: Apparent bug in g++ 2.5.2 +// Date: Wed, 10 Nov 93 18:24 PST + +class One { + public: + One() {} +}; + +template class Two : public One { +}; + +class Three { +}; + +class Four { + Two x[1]; +}; + +class Five { + Four y; + + public: + Five() {} +};
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: unsorted2.C =================================================================== --- unsorted2.C (nonexistent) +++ unsorted2.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed unsorted +// code-gen file +// From: klaus@steinitz.mathematik.uni-dortmund.de +// Date: Mon, 15 Nov 1993 16:51:11 +0100 +// Message-ID: <9311151551.AA17761@steinitz.mathematik.uni-dortmund.de> + +template +class X +{ +}; + +template +X f(X,X) +{ + X result; + return result; +} + +int main() +{ + X<1,3> x; + X<1,2> y; + X<2,3> z; + x=f(y,z); +}
unsorted2.C Property changes : Added: svn:eol-style ## -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,27 @@ +// { dg-do assemble } +// { dg-options "-fshort-enums" } +// GROUPS passed enums +// enum file +// From: Jeff Gehlhaar +// Date: Mon, 4 Jan 1993 09:20:50 -0700 +// Subject: Enum bug, affects library +// Message-ID: <9301041720.AA17340@harvey> + +typedef unsigned long __fmtflags; +class ios { + public: + typedef __fmtflags fmtflags; + enum { skipws=01, left=02, right=04, internal=010, + dec=020, oct=040, hex=0100, + showbase=0200, showpoint=0400, uppercase=01000, showpos=02000, + scientific=04000, fixed=010000, unitbuf=020000, stdio=040000, + dont_close=0x80000000 //Don't delete streambuf on stream destruction + }; + + fmtflags setf (fmtflags, fmtflags); +}; + +// from +inline ios& dec(ios& i) +{ i.setf(ios::dec, ios::dec|ios::hex|ios::oct); return i; } +
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: operators27.C =================================================================== --- operators27.C (nonexistent) +++ operators27.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do run } +// GROUPS passed operators +// opr-new file +// From: David Binderman 3841 +// Date: Mon, 21 Jun 93 11:42:11 +0200 +// Subject: G++ 2.4.3 and operator new +// Message-ID: <9306210942.AA10276@slsvitt.us-es.sel.de> + +int FLAG=0; + +#include + +extern "C" int printf( const char *, ...); + +void * operator new(size_t, const std::nothrow_t&) throw() { FLAG=1; return 0; } + +class K { +private: + int i; +public: + K( int j) { + i = j; + } +}; + +int main(void) +{ + K * pK = new (std::nothrow) K( 10); + if ( FLAG != 1 ) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + return 0; +}
operators27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt11.C =================================================================== --- cvt11.C (nonexistent) +++ cvt11.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Date: Tue, 10 Nov 92 11:08:08 PST +// From: rrh@tera.com (Robert R. Henry) +// Message-Id: <9211101908.AA13557@tera.com> +// Subject: type cast of qualified const member breaks g++2.3.1 + +#include + +class Thing{ +private: int x; + public: const int N = -1; // { dg-error "" } bad initialization + Thing(int y); +}; + +class Bar{ public: void doit(void); }; + +void Bar::doit(void) +{ + int i, j; + i = Thing::N; + printf("i = %d\n", i); + + j = (int)Thing::N; + printf("i = %d\n", j); +} +Thing::Thing(int y) { x = y; } +int main(){ Bar x; x.doit(); } +
cvt11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vtable1.C =================================================================== --- vtable1.C (nonexistent) +++ vtable1.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// { dg-options "-w" } +// GROUPS passed vtable +// vtable file +// From: mrs@cygnus.com (Mike Stump) +// Date: Wed, 20 Apr 1994 17:46:11 -0700 +// Subject: vtable name generation is wrong +// Message-ID: <199404210046.RAA25652@rtl.cygnus.com> + +// prepare_fresh_vtable doesn't build the names of +// vtables very well. + +struct B { + virtual void vf() { } +}; + +struct Main { + virtual void vf() { } +}; + +struct Other : public Main, public B { + virtual void vf() { } +}; + +struct D : public Main, public B, public Other { + virtual void vf() { } +} a;
vtable1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: array2.C =================================================================== --- array2.C (nonexistent) +++ array2.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed arrays +// array file +// Message-Id: <"nac.no.188:05.10.92.14.37.45"@nac.no> +// From: frode@auticon.no +// Subject: prototype bug ? +// Date: Thu, 5 Nov 92 15:37:34 PST + + extern unsigned char * (*trt_def(int))[][2]; + extern unsigned char * (trt_rplst(unsigned char *(*)[][2])); // { dg-error "" }
array2.C Property changes : Added: svn:eol-style ## -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,21 @@ +// { dg-do run } +// GROUPS passed code-generation +// code-gen file +// From: Jeffrey C. Gealow +// Date: Sun, 4 Jul 93 18:57:53 -0400 +// Subject: increment bug (0 + 1 + 1 = 3) +// Message-ID: <9307042257.AA23538@mtl.mit.edu> + +#include + +int main() +{ + int i = 0; + (++i)++; + if (i == 2) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +} + +
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: bad-error7.C =================================================================== --- bad-error7.C (nonexistent) +++ bad-error7.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed bad-errors +#include + +class ParX + { + public: + ParX() {} + }; + +class X : public ParX + { + public: + void fn2() { std::cout << "hi" << std::endl; } + }; + +int main() + { + X x; + ParX* pParX = &x; + void (ParX::*p)() = (void (ParX::*)()) &X::fn2; // line 19 + + (pParX->*p)(); + } + + + + + +
bad-error7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt19.C =================================================================== --- cvt19.C (nonexistent) +++ cvt19.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <1166.9307131600@ace.eng.cam.ac.uk> +// From: ajp@eng.cam.ac.uk +// Date: Tue, 13 Jul 93 17:00:44 BST + + +class B {}; + +class A { + public: + operator const B*() const { + return b; + } + private: + B* b; +}; + + +int main() +{ + A a; + if (a!=0) { + } +} +
cvt19.C Property changes : Added: svn:eol-style ## -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,28 @@ +// { dg-do assemble } +// { dg-options "-Wshadow" } +// GROUPS passed shadow-warnings +// shadow file +// Message-Id: <9211061827.AA03517@harvey> +// From: Jeff Gehlhaar +// Subject: GCC Bug.. +// Date: Fri, 6 Nov 1992 10:27:10 -0700 + +class Klasse +{ +public: + Klasse(void); // constructor + int Shadow(void); // member function +private: + long value; +}; + +Klasse::Klasse(void) +{ + value = 0; +} + +static inline unsigned char +Function(int Shadow) +{ + return 0; +}
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: virtual2.C =================================================================== --- virtual2.C (nonexistent) +++ virtual2.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do run } +// GROUPS passed virtual-functions +// Not in g++ bugs snapshot +// From: grande@isi.edu (Jim Grande) +// Subject: g++ 2.3.3 (HPPA) virt class definition dumps core +// Date: 5 Mar 1993 22:51:14 -0500 +// Message-ID: <23611@venera.isi.edu> + +#include + +class doubleclass +{ + public: + double d; + doubleclass(double x = 0) { d = x; }; +}; + +class test +{ + doubleclass doublec; +}; + +class vderived : virtual public test +{ +}; + +int main() +{ + vderived v; + + printf ("PASS\n"); +}
virtual2.C Property changes : Added: svn:eol-style ## -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,22 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: kol@world.std.com (Nikolay Yatsenko) +// Date: Wed, 27 Jan 1993 16:39:00 -0500 +// Subject: g++ bug +// Message-ID: <199301272139.AA25442@world.std.com> + +int x; + +int main(void) +{ + static int s; + int x; // { dg-error "" } declared + extern int g(); + + struct local { + int g() { return x; } // illegal (non-static x); g++ does not give error// { dg-error "" } + int h() { return s; } // ok, but g++ give error + }; + return 0; +}
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: union3.C =================================================================== --- union3.C (nonexistent) +++ union3.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed unions +// anon-union file +// From: dcb@us-es.sel.de (David Binderman 3841) +// Date: Tue, 30 Mar 93 09:06:15 +0200 +// Subject: Page 183 of the ARM +// Message-ID: <9303300706.AA17079@slsvitt> + +static union { + char* uC; +private: + int uI;// { dg-error "" } +};
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: except3.C =================================================================== --- except3.C (nonexistent) +++ except3.C (revision 816) @@ -0,0 +1,50 @@ +// { dg-do assemble } +// { dg-options "-fexceptions" } +// GROUPS passed exceptions +// except file +// Message-Id: <9211301118.AA09810@ss670mp.geco.slb.com> +// From: willoch@ss670mp.oslo.sgp.slb.com (thorbjorn willoch) +// Subject: -fansi-exceptions bug +// Date: Mon, 30 Nov 92 11:18:05 GMT + +extern "C" int printf(const char *, ...); + +class Vector +{ + int* p; + int sz; + public: + Vector(int s) { p = new int[sz=s]; } + ~Vector() {delete [] p; } + int size() {return sz; } + class Range{}; + + + int& operator[](int i); +}; + +int& Vector::operator[](int i) +{ + if(0<=i && i
except3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temps6.C =================================================================== --- temps6.C (nonexistent) +++ temps6.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed temps +// Date: Tue, 22 Mar 94 12:46:28 +0100 +// From: dak@pool.informatik.rwth-aachen.de +// Message-Id: <9403221146.AA07815@messua> +// Subject: Bad code for pointer to member use as reference in g++ 2.5.8 + +#include +struct str { + int i; +} xxx = {0}; + +int& test(str *arg1, int str::*arg2) +{ + return (arg1->*arg2); +} + +int main() +{ + test(&xxx, &str::i) = 5; + if (xxx.i == 0) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
temps6.C Property changes : Added: svn:eol-style ## -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,42 @@ +// { dg-do run } +// GROUPS passed conversions +#include +#include +#include +#include +#include + +class cvec { +public: + ~cvec(){ delete s; } + cvec(const char*x) { s = new char[std::strlen(x)+1]; std::strcpy(s, x); } + cvec(const cvec& c) { s = new char[std::strlen(c.s)+1]; std::strcpy(s, c.s); } + operator const char*() { return s; } +private: + char *s; +}; + +cvec +B(const char* a) +{ + return a; +} + +void +A(const char* s) +{ + // s still ok here + std::ifstream inf(s); + if (std::strncmp ("aaa", s, 3)) + { + std::printf ("FAIL\n"); + std::exit (1); + } + else + std::printf ("PASS\n"); +} + +int main() +{ + A(B("aaa")); +}
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: operators11.C =================================================================== --- operators11.C (nonexistent) +++ operators11.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-eq file +// Message-Id: +// From: rowlands@hc.ti.com (Jon Rowlands) +// Subject: g++ 2.4.5: assignment operator in base class +// Date: Mon, 30 Aug 1993 00:54:29 GMT + +class B { +public: + B & operator = (B); // delete this line and problem goes away +}; + +class D : public B { +public: + D(); + D(int); + D(B); +}; + +int +main() { + B b; + D d; + + d = d; + + d = 0; // t.cxx:20: assignment not defined for type `D' + d = D(0); + + d = b; // t.cxx:23: assignment not defined for type `D' + d = D(b); + + return(0); +} +
operators11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeck4.C =================================================================== --- typeck4.C (nonexistent) +++ typeck4.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed typeck +class A { + public: + const int &operator[]( int i ); + private: + int k; +}; + +const int& A::operator[]( int i ) +{ + return k; +} + + +void ff( A &anA ) +{ + int &ani = anA[0];// { dg-error "" } + + ani = 7; +}
typeck4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing4.C =================================================================== --- parsing4.C (nonexistent) +++ parsing4.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: Glenn Engel +// Date: Fri, 29 Jan 93 18:42:03 PST +// Subject: Parse Error +// Message-ID: <9301300242.AA15550@hplslk.lsid.hp.com> + +int test1(void (**roc)(int,int)); // parse error +int test2(int id,void (**orc)(int,int)); // works
parsing4.C Property changes : Added: svn:eol-style ## -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,13 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed initialization +class Time; +class TimeNote; + +class SvTime +{ +public: + static TimeNote *time_events = 0;// { dg-error "" } .* +}; + +SvTime CurrentTime = {0};// { 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: operators19.C =================================================================== --- operators19.C (nonexistent) +++ operators19.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-ampr file +// From: Jarkko Sonninen +// Date: Thu, 7 Oct 1993 08:25:26 +0200 +// Subject: type of base class member +// Message-ID: <199310070625.AA18653@kaisa.it.lut.fi> + +class A { + public: + int j; +}; + +class B: public A { + public: + B () { + !(A::j); + }; +};
operators19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: missed-error1.C =================================================================== --- missed-error1.C (nonexistent) +++ missed-error1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed missed-error +// missed-error file +// From: John Carr +// Date: Tue, 02 Feb 1993 07:38:53 EST +// Subject: Re: g++ ignores language context of function pointers +// Message-ID: <9302021238.AA01513@Achates.MIT.EDU> + +typedef void (*pfv)(); +void f (); + +extern "C" +{ + typedef void (*pcfv)(void); + void cf (void); +} + +pfv p = f; +pfv p2 = cf; // { dg-error "" "" { xfail *-*-* } } mismatch +pcfv p3 = f; // { dg-error "" "" { xfail *-*-* } } mismatch +pcfv p4 = cf;
missed-error1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg3.C =================================================================== --- arg3.C (nonexistent) +++ arg3.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +typedef void* Ptr; + + +void func(int, const Ptr& p); + +template void func(T, const Ptr& p); + + +Ptr& return_ref(); + + +int main() +{ + char* x; + + func(x,return_ref()); // bug: + // call of func(int, const Ptr&) + // instead of func(char*,const Ptr&) + +}
arg3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility15.C =================================================================== --- visibility15.C (nonexistent) +++ visibility15.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: wpsun4!xinforms!johnjo@uunet.uu.net (John D. Johnson) +// Date: Wed, 4 Aug 93 13:25:25 MDT +// Subject: Access to private 'operator new()' +// Message-ID: <9308041925.AA09825@xinforms.wpunix +#include +#include + +class X { +private: + void* operator new(size_t) throw(){// { dg-error "" } .* + printf("Inside private new().\n"); + return NULL; + } +public: + X() {} +}; + + +int main(void) +{ + X* p = new X;// { dg-error "" } .* +}
visibility15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt20.C =================================================================== --- cvt20.C (nonexistent) +++ cvt20.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9307152250.AA24812@volterra> +// From: rst@ai.mit.edu (Robert S. Thau) +// Subject: g++ won't convert char[] to char*& +// Date: Thu, 15 Jul 93 18:50:59 EDT + + +// Compiles fine with Sun CC 2.1 + +void f(char *& x) // { dg-error "passing argument" } +{ + x++; +} + +int main() +{ + f ("foo"); // { dg-error "invalid initialization" } +}
cvt20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors14.C =================================================================== --- ctors14.C (nonexistent) +++ ctors14.C (revision 816) @@ -0,0 +1,43 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: <199301310203.AA22417@oak.ucsc.edu> +// From: "Dean R. E. Long" +// Subject: problems with default constructors +// Date: Sat, 30 Jan 1993 18:03:32 -0800 + +class A0 { +}; + +class A1 { +public: + A1(void) {} +}; + +class A2 { + A1 a; +}; + +class B0 : public A0 { +public: + B0(void) {} + B0(int) {} + B0(char) : A0() {} + B0(short) : A0() {} +}; + +class B1 : public A1 { +public: +}; + +class B2 : public A2 { +public: + B2(void) : A2() {} + B2(int) : A2() {} +}; + +class C : public B1 { +public: + C(void) : B1() {} + C(int) : B1() {} +};
ctors14.C Property changes : Added: svn:eol-style ## -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,22 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-pl file +// Message-Id: <9212010409.AA24967@zeus.research.otc.com.au> +// From: grahamd@zeus.research.otca.oz.au (Graham Dumpleton) +// Subject: Failure to use conversion operator. +// Date: Tue, 1 Dec 92 15:11:18 EST + +class BUG1 +{ + public: + + operator const char*() const { return myData; } + const char* myData; +}; + +void bug1() +{ + BUG1 bug1; + bug1.myData = "0123456789"; + const char* s = bug1 + 1; +}
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,16 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <199301260140.AA13734@world.std.com> +// From: gparker@world.std.com (Glenn P Parker) +// Subject: gcc bug +// Date: Mon, 25 Jan 1993 20:40:44 -0500 + +int f() { return 1; } + +int main() +{ + int (&fr)() = f; + + return 0; +}
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: inline4.C =================================================================== --- inline4.C (nonexistent) +++ inline4.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do run } +// GROUPS passed inlining +// inline file +// Message-Id: <9306020823.AA14027@joker> +// From: stefan@mpi-sb.mpg.de +// Subject: gcc-2.4.2 template function bug (1) +// Date: Wed, 2 Jun 93 10:23:14 +0200 + +extern "C" int printf (const char *, ...); + +template inline T func(const T& x) { return x; } + +inline int func(const int& x) { return x; } + + +int main() +{ int x; + func(x); + printf ("PASS\n"); + } +
inline4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing10.C =================================================================== --- parsing10.C (nonexistent) +++ parsing10.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: Eirik Fuller +// Date: Wed, 15 Dec 1993 17:06:11 -0500 +// Subject: parse error +// Message-ID: <199312152206.AA06584@tonttu.TC.Cornell.EDU> + + +class s; + +template +class t +{ +public: + void f(T *t); +}; + +class l +{ +public: + void s() {}; +}; + +extern t g; + +class p +{ +public: + void *h; + s *a() {return (s *) h;}; +};
parsing10.C Property changes : Added: svn:eol-style ## -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,26 @@ +// { dg-do assemble } +// GROUPS passed initialization +// init file +// From: Ingo Donasch +// Date: Wed, 16 Jun 93 13:28:55 +01:00 +// Subject: g++-2.4.2 bug report +// Message-ID: <199306161128.AA22079@opamp.specs.de> + +class b; + +class a { +public: + a(const b*); // needs this parameter +}; + +class b { +private: + a three[3]; +public: + b(); +}; + +b::b() : three(this) // { dg-error "bad array initializer" } +{ +} +
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: incdec1.C =================================================================== --- incdec1.C (nonexistent) +++ incdec1.C (revision 816) @@ -0,0 +1,47 @@ +// { dg-do assemble } +// { dg-options "-w -O3" } +// GROUPS passed incdec +typedef void* Pix; +class ndbArtPtrVec +{ +public: + ndbArtPtrVec (ndbArtPtrVec&); +}; +class intndbArtPtrVecMap +{ +protected: + int count; + ndbArtPtrVec def; + intndbArtPtrVecMap(ndbArtPtrVec& dflt); + virtual ndbArtPtrVec& operator [] (int key) = 0; + virtual void del(int key) = 0; +public: + virtual Pix first() = 0; + virtual void next(Pix& i) = 0; + virtual int& key(Pix i) = 0; + virtual ndbArtPtrVec& contents(Pix i) = 0; +}; +struct intndbArtPtrVecAVLNode +{ + ndbArtPtrVec cont; + intndbArtPtrVecAVLNode(int h, ndbArtPtrVec& c, + intndbArtPtrVecAVLNode* l=0, intndbArtPtrVecAVLNode* r=0); +}; +class intndbArtPtrVecAVLMap : intndbArtPtrVecMap +{ +protected: + intndbArtPtrVecAVLNode* root; +public: + ndbArtPtrVec& operator [] (int key); + intndbArtPtrVecAVLMap(intndbArtPtrVecAVLMap&); +}; +ndbArtPtrVec& intndbArtPtrVecAVLMap::operator [] (int item) +{ + ++count; + root = new intndbArtPtrVecAVLNode(item, def); +} +intndbArtPtrVecAVLMap::intndbArtPtrVecAVLMap(intndbArtPtrVecAVLMap& b) :intndbArtPtrVecMap(b.def) +{ + for (Pix i = b.first(); i != 0; b.next(i)) + (*this)[b.key(i)] = b.contents(i); +}
incdec1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors4.C =================================================================== --- ctors4.C (nonexistent) +++ ctors4.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do run } +// { dg-options "-w" } +// GROUPS passed constructors +// ctors file +// Message-Id: +// From: Alf-Christian Achilles +// Subject: g++ 2.3.1 rejects initialization with object of derived class +// Date: 25 Nov 92 19:21:23 + +extern "C" int printf (const char *, ...); + +class A { +public: + virtual void foo() {}; +}; + +class B : public A { +public: + void foo() {}; +}; + +main () +{ + B b; + A a = b; //unjustified error: unexpected argument to constructor `A' + printf ("PASS\n"); +} +
ctors4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm10.C =================================================================== --- arm10.C (nonexistent) +++ arm10.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <1oab2hINN7m@gap.caltech.edu> +// From: tll@cco.caltech.edu (Tal Lewis Lancaster) +// Subject: ARM Page 65 +// Date: 18 Mar 1993 17:21:21 GMT + +int(*p)[10]=new int[20][10];
arm10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: profile1.C =================================================================== --- profile1.C (nonexistent) +++ profile1.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do run } +// { dg-require-profiling "-pg" } +// { dg-options "-pg" } +// { dg-options "-pg -static" { target hppa*-*-hpux* } } +// GROUPS passed profiling +#include +main() +{ + printf ("PASS\n"); +}
profile1.C Property changes : Added: svn:eol-style ## -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,34 @@ +// { dg-do assemble } +// GROUPS passed access +// access file +// Message-Id: <9211281852.AA24557@cove.cis.ufl.edu> +// From: Robert Forsman +// Subject: method access bug in gcc-2.3.1 on a sparc-sun-sunos4.1.2 +// Date: Sat, 28 Nov 92 13:52:14 EST + +extern "C" { + int atoi(const char*); +} + +struct thingus; + +class foo { +public: + static const foo alpha; + static const foo beta; + +private: + int i; + foo(thingus * s); +public: + foo() {i=0;} +}; + +struct thingus { + int i; +}; + +static thingus blah, blah2; + +const foo foo::alpha(&blah); +const foo foo::beta(&blah2);
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: enum3.C =================================================================== --- enum3.C (nonexistent) +++ enum3.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed enums +// enum file +// From: frode@auticon.no +// Date: Wed, 13 Jan 93 9:24:50 PST +// Subject: enum trouble +// Message-ID: <"nac.no.001:13.00.93.18.40.52"@nac.no> + +typedef enum{on, off} TOGGLE; + +class field { +private: + TOGGLE toggle; +public: + virtual void on(void) { toggle = 3; };// { dg-error "" } .* + virtual void off(void) { toggle = on; };// { dg-error "" } .* +}; + +int main() +{ +}
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: operators28.C =================================================================== --- operators28.C (nonexistent) +++ operators28.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed operators +#include +#include + +class new_test +{ + int type; +public: + void* operator new(size_t sz, int count, int type); +}; + +void* new_test::operator new(size_t sz, int count, int type) +{ + void *p; + + printf("%d %d %d\n", sz, count, type); + + p = new char[sz * count]; + ((new_test *)p)->type = type; + return p; +} + +int main() +{ + new_test *test; + int count = 13; + + test = new(count, 1) new_test; +}
operators28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility24.C =================================================================== --- visibility24.C (nonexistent) +++ visibility24.C (revision 816) @@ -0,0 +1,40 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: joe@consolve.com (Joe Shapiro) +// Date: Fri, 20 Aug 93 17:18:18 EDT +// Subject: Template classes seem to allow users to get at private members +// Message-ID: <9308202118.AA25599@ghana.consolve> +/* + * private.cc + */ +extern "C" int printf (const char *, ...); + +template +class A +{ +public: + void Fun() { printf( "Fun fun fun!\n" ); } // { dg-error "" } private +}; + + +template +class B: private A +{ +}; + + +class C +{ +public: + C() { _b.Fun(); }// { dg-error "" } .* + +private: + B _b; +}; + + +int main() +{ + C c; +}
visibility24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt12.C =================================================================== --- cvt12.C (nonexistent) +++ cvt12.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do run } +// GROUPS passed conversions +// cvt file +// Message-Id: <9301071708.AA03432@muresh.et.tudelft.nl> +// From: stravers@muresh.et.tudelft.nl (Paul Stravers) +// Subject: conversion method never called +// Date: Thu, 7 Jan 93 18:08:33 +0100 + +#include + +class test +{ + double d; + int i; +public: + test(double dd,int ii) {d=dd; i=ii;} // constructor + operator int&() {return i;} // define a conversion from test to int& + int& geti() {return i;} // same thing, but different +}; + +int main() +{ + test t(3.14, 5); // Create an object t of class "test" + int x = (int&)t; // This should call operator int&() but it does not ... + int y = t.geti(); // x and y should both be 5 ... + if (x == 5 && y == 5) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
cvt12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vtable2.C =================================================================== --- vtable2.C (nonexistent) +++ vtable2.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed vtable +struct C1 +{ + virtual ~C1(); +}; + +struct C2 : public virtual C1 +{ + virtual ~C2(); +}; + +struct C3 : public virtual C2 +{ + virtual ~C3(); +}; + +C3::~C3() {}
vtable2.C Property changes : Added: svn:eol-style ## -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,35 @@ +// { dg-do run } +// GROUPS passed code-generation +// code-gen file +// From: Gunther Seitz +// Date: Thu, 18 Mar 1993 10:45:29 +0100 +// Message-ID: <93Mar18.104538met.1094@regatta.regent.e-technik.tu-muenchen.de> + + +#include + +class X { + +public: + double x; + X () { x=3.5; } // Here we go. This assignment fails because + // of X::x being aligned on a doubleword + // boundary, not a quadword one. + }; + + +class A : public virtual X {}; // Only way to produce the +class B : public virtual X {}; // error is to use this +class C : public virtual X {}; // construct of virtual + // base classes. + +class Y : public A, public B, public C {}; + + +int main () +{ + Y y; // To call the constructor + printf ("PASS\n"); + } + +
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: shadow2.C =================================================================== --- shadow2.C (nonexistent) +++ shadow2.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// { dg-options "-Wshadow" } +// GROUPS passed shadow-warnings +// (Message bugs/shadow:2) +// From: michael@utex.rni.sub.org (Michael Utech) +// Date: Sat, 22 Jan 1994 04:28:00 +0100 +// Subject: very minor problem/bug in gcc-2.5.4, -Wshadow +// Message-ID: + +class X +{ + int count; +public: + X() {} // necessary to produce the `count' warning +}; + +template +class Y +{ + T t; +public: + int f (int count) { return (count); } +}; + +main () +{ + Y y; +}
shadow2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual3.C =================================================================== --- virtual3.C (nonexistent) +++ virtual3.C (revision 816) @@ -0,0 +1,49 @@ +// { dg-do run } +// GROUPS passed virtual-functions +// virtual file +// From: allan@ramjet.multinet.DE (Allan Brighton) +// Subject: pos. bug in gcc-2.5.2 on hp +// Date: 4 Nov 1993 22:57:36 -0500 +// Message-ID: <9311041820.AA05942@ramjet.multinet.DE> + +#include +#include + +using namespace std; + +class BugStream : public ostringstream { +public: + BugStream() {} + BugStream& eval(); +}; + + +static struct Eval_ { } eval; +BugStream& operator<<(ostream& os, Eval_); + +BugStream& BugStream::eval() +{ + // make sure str is null terminated + *this << ends; + + // eval the command and set the status + const char* s = str().data(); + cerr << s << endl; + + // reset the stream for the next command + clear(ios::goodbit); + // rdbuf()->freeze(0); + seekp(0); + + return *this; +} + +BugStream& operator<<(ostream& os, Eval_) +{ + return ((BugStream&)os).eval(); +} + +int main() { + BugStream bs; + bs << "PASS" << eval; +}
virtual3.C Property changes : Added: svn:eol-style ## -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,25 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: dcb@us-es.sel.de (David Binderman 3841) +// Date: Tue, 30 Mar 93 15:48:47 +0200 +// Subject: page 242 of the ARM +// Message-ID: <9303301348.AA20751@slsvitt> + +class A { +public: + int b; // { dg-error "" } private +}; + +class C : private A { // NOTE WELL. private, not public +public: + int d; +}; + +extern "C" int printf( const char *, ...); + +class E : public C { + void f() { + printf( "%d\n", b);// { dg-error "" } .* + }; +};
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: union4.C =================================================================== --- union4.C (nonexistent) +++ union4.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed unions +// anon-union file +// From: hossein@veritas.com (Hossein Raassi) +// Date: Wed, 15 Dec 93 13:52 PST +// Subject: Internal Error +// Message-ID: + +static union { + struct SS { + int ss; + }; +};// { dg-error "" } .*
union4.C Property changes : Added: svn:eol-style ## -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,13 @@ +// { dg-do assemble } +// GROUPS passed destructors +// friends file +// From: offline!marc@ai.mit.edu (Marc Duponcheel) (Marc Duponcheel) +// Date: Sat, 6 Feb 93 23:31:22 PST +// Subject: some 2.2.2 bugs +// Message-ID: <9302070731.AA002jw@offline.UUCP> + +void f() +{ + int i; + i.i::~i();// { dg-error "" } .* +}
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: except4.C =================================================================== --- except4.C (nonexistent) +++ except4.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do assemble } +// { dg-options "-fexceptions" } +// GROUPS passed exceptions +// except file +// Message-Id: <9307071456.AA05275@davinci.hio.hen.nl> +// From: akkersdi@hio.hen.nl +// Subject: exceptions broken +// Date: Wed, 7 Jul 1993 16:56:52 +0200 (MET DST) + +class ball { +public: int dummy; + ball() : dummy(0) { ; } +}; + +void pitcher() +{ + throw ball(); +} + +void catcher() +{ + try // <=== gcc 2.* fails here + { + pitcher(); + } + catch (ball) { + /* sleepy catcher doing nothing */ ; + } +} + +int main() +{ + catcher(); +}
except4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temps7.C =================================================================== --- temps7.C (nonexistent) +++ temps7.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed temps + +template +class A { +public: + class C {}; +}; + +template class A::C; +
temps7.C Property changes : Added: svn:eol-style ## -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,16 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9308122113.AA14119@tnt.acsys.com> +// From: mclaugh@tnt.acsys.com (Mark A. McLaughlin) +// Subject: g++ bug +// Date: Thu, 12 Aug 93 15:13:23 MDT + + +class C { }; + +void f(C) { } + +void g(const C & c) { f(c); } + +void h(const C & c) { f(C(c)); }
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: operators12.C =================================================================== --- operators12.C (nonexistent) +++ operators12.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-eq file +// Message-Id: <199311181618.AA27761@oil.cs.columbia.edu> +// From: Sam Fenster +// Subject: g++ 2.5.3 can't disable assignment +// Date: Thu, 18 Nov 1993 11:18:18 -0500 + +class B + { + B &operator = (const B &); //Disable assignment! + public: + virtual ~B () {} + }; + +class D: public B + { + public: + D () {} + };
operators12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing5.C =================================================================== --- parsing5.C (nonexistent) +++ parsing5.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed parsing +// From: Teemu Torma +// Date: Mon, 15 Jun 92 18:42:25 +0300 +// Subject: G++ 2.2.2: Strange parse error +// Message-ID: <"relay.fren.501:15.05.92.15.42.30"@frend.fi> + +long (*foo1 ()) (); // This is ok. + +typedef long INT; +INT (*foo2 ()) (); // This is not, g++ says "parse error before `('"
parsing5.C Property changes : Added: svn:eol-style ## -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,18 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed initialization +// init file +// From: dcb@us-es.sel.de +// Date: Mon, 12 Oct 92 07:51:52 +0100 +// Subject: G++, ARM Page 141 +// Message-ID: <9210120651.AA15257@us-es.sel.de> + +extern int fred( int); + +class X { + public : + void f( int = fred( 0) ) ; // { dg-error "" } previous spec +} ; + +void X::f( int x = fred( 0) ) {// { dg-error "" } .* +}
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: dossier1.C =================================================================== --- dossier1.C (nonexistent) +++ dossier1.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// { dg-options "-frtti" } +// GROUPS passed rtti +// dossier file +// Message-Id: <9212021501.AA02484@olympia.miro.com> +// From: rme@miro.com (Richard M. Emberson) +// Subject: bug +// Date: Wed, 2 Dec 92 07:01:30 PST + +class Vector { + int *p; + int sz; +public: + Vector(int ); + ~Vector(); + + int& operator[](int i); +};
dossier1.C Property changes : Added: svn:eol-style ## -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,20 @@ +// { dg-do assemble } +// GROUPS passed scoping +// scoping file +// From: kol@world.std.com (Nikolay Yatsenko) +// Date: Fri, 16 Jul 1993 18:48:32 -0400 +// Subject: g++ gives wrong error for local structure +// Message-ID: <199307162248.AA05360@world.std.com> + +int main(void) +{ + struct A{ + public: int i; + void set (int i) + {A::i = i;} // g++ gives wrong error + }; + + A a; + a.set(17); + return 0; +}
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: missed-error2.C =================================================================== --- missed-error2.C (nonexistent) +++ missed-error2.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed missed-error +// missed-error file +// From: ndc!don@csvax.cs.caltech.edu (Don Erway) +// Date: Thu, 21 May 92 15:40:45 PDT +// Subject: More on [g++ 2.1 : overloaded function selection incorrect] +// Message-ID: <9205212240.AA17934@ndc.com> + +#include + +inline int max(int a, int b) {return a > b ? a : b;}; // { dg-error "" } candidate +inline double max(double a, double b) {return a > b ? a : b;}; // { dg-error "" } candidate + +int main() { + static void foo(int i, int j, double x, double y) ;// { dg-error "" } .* + + foo(4, -37, 14.39, 14.38); +} + +// 971006 we no longer give an error for this since we emit a hard error +// about the declaration above +static void foo(int i, int j, double x, double y) { + + std::cout << "Max(int): " << max(i,j) << " Max(double): " << +max(x,y) << '\n'; + std::cout << "Max(int, double): " << max(i, y) << '\n';// { dg-error "" } +} +
missed-error2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg4.C =================================================================== --- arg4.C (nonexistent) +++ arg4.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <14t4tyk@rpi.edu> +// From: jorgej@colossus.cs.rpi.edu (Joaquim Jorge) +// Subject: g++ 2.3.3 Doesn't check function types in initializer lists ? +// Date: Tue, 9 Mar 1993 21:39:08 GMT + +typedef void (*FuncPtr)(int a, float b); +class Amazing { int a; int b; int c; }; + +extern void *Wrong1(char *a, int *b); +extern void *Wrong2(Amazing a, int *b); +extern void *Wrong3(char *a, Amazing *b); +extern void Wrong4(char *a, int *b); +extern Amazing Wrong5(char *a, int *b); + +FuncPtr p = &Wrong5;// { dg-error "" } .* +FuncPtr func_ptr_array[] = { &Wrong1, &Wrong2, &Wrong3, &Wrong4, &Wrong5, 0 };// { dg-error "" } .* +
arg4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility16.C =================================================================== --- visibility16.C (nonexistent) +++ visibility16.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Marie Trapp +// Date: Thu, 5 Aug 93 11:55:15 EDT +// Subject: access of protected members +// Message-ID: <9308051553.AA07639@nwd2sun1.analog.com> +class A { + protected: + int astuff; // { dg-error "" } protected + A() { + astuff = 3; + } +}; + +class B : public A { + int bstuff; + public: + B( A *p) { + bstuff = p->astuff;// { dg-error "" } .* + } +}; + +class C : public A { + int cstuff; + public: + C() { + cstuff = 5; + } +}; + +int main() { + C cvar; + B bvar(&cvar); +}
visibility16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt21.C =================================================================== --- cvt21.C (nonexistent) +++ cvt21.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9307200528.AA02094@legolas> +// From: Mark Kuzmycz +// Subject: int & conversion operator +// Date: Tue, 20 Jul 93 15:28:47 EST + +class Int +{ + public: + Int(void); + Int(int); + Int(const Int&); + + Int* copy(void) const; + + operator int&(); + + Int& operator ++(void); + Int& operator --(void); + + private: + int value; +}; + +int main() +{ + Int data = 2; + Int test; + + test = data * 12; + data += 1; +} + +// UNKNOWN "FAIL"
cvt21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors15.C =================================================================== --- ctors15.C (nonexistent) +++ ctors15.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do run } +// GROUPS passed constructors +// ctor file +// Message-Id: <9303270404.28207@munta.cs.mu.OZ.AU> +// From: fjh@cs.mu.oz.au +// Subject: bug with new/delete of multidimensional array +// Date: Sat, 27 Mar 93 14:04:52 EST + +#include +#include + +int construct = 0; + +class Element { +public: + Element() { construct++; if (construct > 6) {printf ("FAIL\n"); exit(1);}} + ~Element() { } +}; + +typedef Element array[2]; + +int main() { + array *x; + x = new array[3]; + delete x; + printf ("PASS\n"); +}
ctors15.C Property changes : Added: svn:eol-style ## -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,32 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-del file +// From: rollins@bart.ee.queensu.ca (Mark Rollins) +// Date: Thu, 3 Sep 1992 22:01:03 -0400 Fri, 4 Sep 1992 02:00:25 GMT +// Subject: delete [size] pointer; Problem +// Message-ID: <92Sep3.220137edt.30@jarvis.csri.toronto.edu> + +#include +typedef std::complex Complex; +#include + +class Vector { + int size; + Complex *v; + public: + Vector(int s=1) { size = s; v = new Complex[size];}; + ~Vector() { delete [size] v;}// { dg-error "" } warning +}; + +void foo(int s) +{ + Vector junk(s); +} + +int main() +{ + Vector* test; + for (int i=0;i<40;i++) // was 100000 + foo(1000); + printf ("PASS\n"); +}
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: arm3.C =================================================================== --- arm3.C (nonexistent) +++ arm3.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <199301260139.AA13555@world.std.com> +// From: gparker@world.std.com (Glenn P Parker) +// Subject: gcc bug +// Date: Mon, 25 Jan 1993 20:39:19 -0500 + +class X { + enum S { blue, pink }; + int S; +public: + void f (enum S arg) ; +}; + +void X::f (enum S arg) +{ + S = arg; // g++ gives error on this line. +} +
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: init11.C =================================================================== --- init11.C (nonexistent) +++ init11.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed initialization +// init file +// From: hansen@srd.ull.rdc.toshiba.co.jp +// Date: Mon, 13 Dec 93 18:27:51 +0900 +// Subject: g++ Bug +// Message-ID: <9312130927.AA08192@VLCS151.noname> + +#include + +int X = 7; + +struct foo { + int a,b,c; +}; + +struct foo Ack = {5, X, 3}; + +int main() +{ + if (Ack.a == 5 && Ack.b == 7 && Ack.c == 3) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
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: patches1.C =================================================================== --- patches1.C (nonexistent) +++ patches1.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed patches +// patches file +// From: david.binderman@pmsr.philips.co.uk +// Date: Wed, 6 Oct 93 17:05:54 BST +// Subject: Reno 1.2 bug fix +// Message-ID: <9310061605.AA04160@pmsr.philips.co.uk> + +int type(float) { return 1; } +int type(double) { return 2; } +int type(long double) { return 3; } + +extern "C" int printf( const char *, ...); + +int main() +{ + int i = 0; + if (type(0.0) != 2) + ++i; + if (i > 0) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
patches1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors5.C =================================================================== --- ctors5.C (nonexistent) +++ ctors5.C (revision 816) @@ -0,0 +1,33 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctors file +// Subject: bug in handling static const object of the enclosing class +// Date: Tue, 1 Sep 92 10:38:44 EDT + +class X +{ // { dg-error "X::X" } implicit constructor + private: + int x; + public: + static const X x0; + X( int ); +}; + +class Y +{ + private: + X xx; + public: + Y(); +} +X::X( int xi ) // { dg-error "return type|X::X|semicolon" } +{ + x = xi; +} + +const X X::x0( 0 ); + +Y::Y() // { dg-error "no match" } +{ + xx = X::x0; +}
ctors5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators21.C =================================================================== --- operators21.C (nonexistent) +++ operators21.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed operators + +struct A { + int x; +}; + +int operator()(A x,float y) {// { dg-error "" } .* + return 1; +} + +int main() { + A x; + x(1.0); // { dg-error "" } no match +} +
operators21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm11.C =================================================================== --- arm11.C (nonexistent) +++ arm11.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <9302181055.AA12522@slsvitt> +// From: dcb@us-es.sel.de (David Binderman 3841) +// Subject: Page 81 of the ARM +// Date: Thu, 18 Feb 93 11:55:15 +0100 + + +int main() { + int x[ 10, 11]; // { dg-error "" } .* + + return 0; +} +
arm11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access2.C =================================================================== --- access2.C (nonexistent) +++ access2.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed access +// access file +// Message-Id: <9306301534.AA05072@sparc1.cnm.us.es> +// From: juando@cnm.us.es (Juan D. Martin) +// Subject: Compiler lets access to private constructor in template. +// Date: Wed, 30 Jun 93 17:34:10 +0200 + +template class Foo +{ +private: + friend class Bar; // To avoid warning. + Foo(const T &v) {}; // { dg-error "" } private +}; + + +int main() +{ + Foo(1);// { dg-error "" } +}
access2.C Property changes : Added: svn:eol-style ## -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,29 @@ +// { dg-do assemble } +// GROUPS passed enums +// enum file +// From: dougm@cs.rice.edu (Doug Moore) +// Date: Thu, 18 Mar 93 00:14:57 CST +// Subject: 2.3.3:Inconsistent behavior for enum conversions +// Message-ID: <9303180614.AA12123@cs.rice.edu> + +enum Enum {enumerator1, enumerator2}; + +struct Struct +{ + int i; + int getI(Enum) {return i;} // { dg-error "" } candidates +}; + +int funct (Enum) +{ + return 0; +} + +int main() +{ + Enum e = enumerator1; + Struct s; + int x = funct(e+1);// { dg-error "" } .* + int y = s.getI(e+1);// { dg-error "" } .* + return x+y; +}
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: operators29.C =================================================================== --- operators29.C (nonexistent) +++ operators29.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed operators +// (Message bugs/opr-del:4) +// From: jamshid@ses.com (Jamshid Afshar) +// Date: Fri, 25 Feb 94 18:44:01 CST +// Subject: Re: delete on "smart pointers" +// Message-ID: <9402262328.AA16321@pancake> +// +// Who was apparently replying to kuhlins@hawk.wifo.uni-mannheim.de + + +template class Ptr { +public: + Ptr(T*); + operator T*(); +}; + +int main() { + Ptr ip = new int(2); + delete ip; + operator delete(ip); + return 0; +}
operators29.C Property changes : Added: svn:eol-style ## -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 nest +// nest file +// From: gs4t@virginia.edu (Gnanasekaran Swaminathan) +// Date: Wed, 30 Dec 1992 20:38:07 GMT +// Subject: Local type names bug in g++ 2.3.3 +// Message-ID: <1992Dec30.203807.17504@murdoch.acc.Virginia.EDU> + +typedef char* T; // { dg-error "" } previous declaration + +struct Y { + T a; + typedef long T; // error. See ARM p189-191 for details// { dg-error "" } + T b; +};
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: visibility25.C =================================================================== --- visibility25.C (nonexistent) +++ visibility25.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: gfm@mencon.mencon.oz.au (Graham Menhennitt) +// Date: Wed, 17 Nov 93 21:30:32 EST +// Subject: gcc 2.5.3 - can't privately inherit and contain same class +// Message-ID: <9311171030.AA00604@mencon> +#include + +class A { +public: + A(void); +}; + +class B : private A { +public: + B(void) : A() {} +}; + +class C : public B { +public: + C(void) : B(), a() {} + +private: + ::A a; +};
visibility25.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bad-error1.C =================================================================== --- bad-error1.C (nonexistent) +++ bad-error1.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed bad-errors +// bad-error file +// Message-Id: <9301081103.AA29469@jclark.com> +// From: jjc@jclark.com (James Clark) +// Subject: initializer for static class member array +// Date: Fri, 8 Jan 93 11:03:05 GMT + +struct A { + static int v[]; +}; + +int A::v[1] = { 1 }; +
bad-error1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vtable3.C =================================================================== --- vtable3.C (nonexistent) +++ vtable3.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed vtable +// vtable file +// From: Pete Bevin +// Date: Mon, 28 Nov 1994 19:57:53 +0000 (GMT) +// Subject: g++-2.6.2: Virtual inheritance causes incorrect padding +// Message-ID: + +extern "C" int printf (const char *, ...); + +struct A { +}; + + +struct B : virtual A { + public: + int b; +}; + + +int main() +{ + B blist[10]; + printf ("PASS\n"); +}
vtable3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt13.C =================================================================== --- cvt13.C (nonexistent) +++ cvt13.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: +// From: ishai@cs.technion.ac.il (& Ben-Aroya) +// Subject: Type conversion problem. +// Date: Fri, 26 Mar 1993 08:25:09 GMT + +typedef int array[10]; + +void f(array &arg) +{ +} + +int main() +{ + array var; + f(var); +}
cvt13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual4.C =================================================================== --- virtual4.C (nonexistent) +++ virtual4.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do run } +// GROUPS passed virtual-functions +#include +#include + +int aset = 0; +class A +{ + public: + void Set() { SetProp(); } + virtual void SetProp() { aset++;} +}; + +class B:public A +{ + public: + void SetProp() { if (!aset) { printf ("FAIL\n"); exit (1);} aset--;} +}; + +int main() +{ + A a; + B b; + A *c=new A; + A *d=new B; + + a.Set(); + b.Set(); + c->Set(); + d->Set(); + printf ("PASS\n"); +}
virtual4.C Property changes : Added: svn:eol-style ## -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,17 @@ +// { dg-do assemble } +// GROUPS passed visibility + +class a { + +private: + a (int i);// { dg-error "" } .* + +public: + a (); +}; + +void test () +{ + a *ap = new a; + a *ap2 = new a (3);// { dg-error "" } .* +}
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: except5.C =================================================================== --- except5.C (nonexistent) +++ except5.C (revision 816) @@ -0,0 +1,40 @@ +// { dg-do assemble } +// { dg-options "-fexceptions" } +// GROUPS passed exceptions +// except file +// Message-Id: <199311101607.AA11803@hsi86.hsi.com> +// From: Grigory Tsipenyuk +// Subject: exception's bug? +// Date: Wed, 10 Nov 1993 11:07:12 -0500 + +#include + +class X { + int *a; + int sz; +public: + class range { }; // exception class + X(int s) { a=new int[sz=s]; } + int& operator[](int i); +}; + +int& X::operator[](int i) +{ + if (i < 0 || i >= sz) { + throw range(); + } + return a[i]; +} + +int +main() +{ + X c(10); + try { + for (int i = 0; i < 12; i++) + c[i] = 1; + } catch (X::range) { + std::cerr << "invalid range\n"; + } + return 0; +}
except5.C Property changes : Added: svn:eol-style ## -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,41 @@ +// { dg-do run } +// GROUPS passed destructors +#include + +int destruct = 0; + +class bla { + +public: + + inline bla(const char * jim) { ; }; + + inline ~bla() { destruct++; if (destruct == 2) printf ("PASS\n");}; +}; + +class ulk { + +public: + + inline ulk() {}; + inline ~ulk() {}; + + void funk(const bla & bob) { ;}; + // ^ interestingly, the code compiles right if + // this & is deleted (and therefore the parameter + // passed as value) +}; + +int main() { + + ulk dumm; + + dumm.funk(bla("laberababa")); // this compiles correctly + + dumm.funk((bla)"laberababa"); // this produces incorrect code - + // the temporary instance of + // the class "bla" is constructed + // but never destructed... + + +}
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: cvt4.C =================================================================== --- cvt4.C (nonexistent) +++ cvt4.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do run } +// GROUPS passed conversions +// cvt file +// Message-Id: <9308091213.AA11572@emmy.Mathematik.Uni-Dortmund.DE> +// From: Michael Strauch +// Subject: Bug in GCC 2.4.5 +// Date: Mon, 9 Aug 93 14:13:50 MESZ + +extern "C" int printf (const char *, ...); + +int destruct = 2; + + class Test{ + protected: + long x; + public: + Test(){;} + Test(long l) {x=l;} + ~Test() {if (--destruct == 0) printf ("PASS\n");} + }; + +int main() + { + long i=1; + Test t; + + t=(Test)i; + }
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: refs1.C =================================================================== --- refs1.C (nonexistent) +++ refs1.C (revision 816) @@ -0,0 +1,43 @@ +// { dg-do run } +// GROUPS passed references +// (Message bugs/refs:1) +// From: tal@vlsi.cs.caltech.edu +// Date: Fri, 25 Feb 94 23:55:50 -0800 +// Subject: g++-2.5.8 produces incorrect code for references +// Message-ID: <9402260755.AA27693@vlsi.cs.caltech.edu> + +#include + +class C { +private: + const char** list; +public: + C(const char** ); + void count (int&); +}; + +C::C (const char** l) { + list = l; +} + +void C::count (int& total) { + if (*list == NULL) + return; + else { + list++; + count (++total); // THIS IS WHERE THE TROUBLE STARTS + } +} + +const char * foo[] = { + "one", "two", "three", NULL}; + +int main() { + C c(foo); + int i = 0; + c.count(i); + if (i == 3) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
refs1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators30.C =================================================================== --- operators30.C (nonexistent) +++ operators30.C (revision 816) @@ -0,0 +1,26 @@ +// { dg-do run } +// GROUPS passed operators +// opr-mm file +// Date: Thu, 2 Jun 94 10:00:29 +0200 +// From: chatty@cenatls.cena.dgac.fr (Stephane Chatty) +// Message-Id: <9406020800.AA14201@geant.cenatls.cena.dgac.fr> +// Subject: result of operator -- with g++-2.5.8 + +#include + +void nop() +{ +} + +int main () +{ + int a = 2; + + if (----a == 0) + nop (); + + if (a == 0) + printf("PASS\n"); + else + { printf("FAIL\n"); return 1; } +}
operators30.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators13.C =================================================================== --- operators13.C (nonexistent) +++ operators13.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-eq file +// Message-Id: <1993Nov18.210502.28842@midway.uchicago.edu> +// From: mps@dent.uchicago.edu (Michael Spertus) +// Subject: g++ 2.5.4 bug : operator= +// Date: Thu, 18 Nov 1993 21:05:02 GMT + +class T { +}; + +class EP { +public: + void operator=(T *); +}; + + +void EP::operator=(T *) { } + +int main() +{ + EP ep1, ep2; + ep1 = ep2; +}
operators13.C Property changes : Added: svn:eol-style ## -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,13 @@ +// { dg-do assemble } +// GROUPS passed initialization +class Vector { + double *v; + int size; + +public: + Vector(int n); + ~Vector(); +}; + +exmpl() { Vector x(8)[16]; }// { dg-error "" } .* +
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: parsing6.C =================================================================== --- parsing6.C (nonexistent) +++ parsing6.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: "James S. Vera" +// Date: Thu, 01 Jul 1993 16:36:32 -0700 +// Subject: Mildly complicated type not understood, 2.4.5 +// Message-ID: <9307012336.AA13841@fanaraaken.Stanford.EDU> + +typedef int (*cow[3])(...); + +int main() { + cow fs; + int (*pig[3])(...); // line 5 + +}
parsing6.C Property changes : Added: svn:eol-style ## -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,45 @@ +// { dg-do run } +// GROUPS passed scoping +// scoping file +// From: svkakkad@cs.utexas.edu (Sheetal V. Kakkad) +// Date: Tue, 5 Oct 93 12:38:49 -0500 +// Subject: G++ 2.4.5 - global delete operator not called when using "::delete" +// Message-ID: <9310051738.AA14586@boogie.cs.utexas.edu> + +#include +#include +#include + +class foo +{ + public: + foo () { ; } + ~foo () { ; } + void *operator new (size_t); + void operator delete (void *); +}; + +void *foo::operator new (size_t size) +{ + return malloc (size); +} + +int overloaded_delete = 0; + +void foo::operator delete (void *data) +{ + free ((char *) data); + overloaded_delete++; +} + +int main () +{ + foo *f = new foo; + foo *ff = ::new foo; + ::delete ff; // should call the default delete operator + delete f; + if (overloaded_delete == 1) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
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,30 @@ +// { dg-do assemble } +// GROUPS passed templates + +class String { + char s[100]; +}; + +template +class Art { +public: + Element *data; + Art() { data=new Element[100]; } +}; + +template +class Assoc { +public: + struct KeyValue { + Key key; + Value value; + int filled; + }; + + Art data; + int fill; +}; + +int main() { + Assoc table; +}
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: arg5.C =================================================================== --- arg5.C (nonexistent) +++ arg5.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +extern double pow(double,int*); + +extern "C" { + extern int printf (const char *, ...); + extern double pow(double, double); +} + +int main() +{ + if (pow (2.0, 3.0) != 8.0) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
arg5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: casts1.C =================================================================== --- casts1.C (nonexistent) +++ casts1.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed casts +// casts file +// From: dcb@us-es.sel.de (David Binderman 3841) +// Date: Thu, 18 Feb 93 14:42:48 +0100 +// Subject: Page 67 of the ARM +// Message-ID: <9302181342.AA14050@slsvitt> + +int main() { + (struct T { int b; } *) 0; // { dg-error "" } + + return 0; +}
casts1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: missed-error3.C =================================================================== --- missed-error3.C (nonexistent) +++ missed-error3.C (revision 816) @@ -0,0 +1,124 @@ +// { dg-do assemble } +// GROUPS passed missed-error +// missed-error file +// From: Neil Wilson +// Date: Tue, 28 Apr 92 13:53:54 WET DST +// Subject: g++ version 2.1 bugs +// Message-ID: <15717.9204281253@cch.coventry.ac.uk> + + +// enum bool { FALSE = 0, TRUE = 1 }; + +typedef int T; + +class Traversable { +public: + virtual const T item() const = 0; + virtual const bool off() const = 0; + virtual ~Traversable() { }; +}; + +class Chain : public Traversable { +public: + virtual const int count() const = 0; + virtual const bool empty() const = 0; + virtual void forth() const = 0; + virtual const bool isfirst() const = 0; + virtual const bool islast() const = 0; + virtual const int position() const = 0; + virtual const T first() const = 0; + virtual const T last() const = 0; + virtual const T i_th(const int index) const = 0; + virtual void start() const = 0; + virtual void back() const = 0; + virtual void finish() const = 0; + virtual void move(const int index) const = 0; + virtual void go(const int index) const = 0; + virtual void put(const T value) = 0; + virtual void put_i_th(const T value, const int index) = 0; + virtual void swap(const int index) = 0; + virtual void wipe_out() = 0; +}; +class List : public Chain { +protected: + int item_count; + int cursor_position; + virtual void go_offleft() const = 0; + virtual void go_offright() const = 0; + virtual void copy(const List& other) = 0; +public: + List() : item_count(0), cursor_position(0) { }; + virtual const int count() const; + virtual const bool empty() const; + virtual const bool isfirst() const; + virtual const bool islast() const; + virtual const bool offleft() const; + virtual const bool offright() const; + virtual const bool off() const; + virtual const int position() const; + virtual const T first() const; + virtual const T last() const; + virtual const T i_th(const int index) const; + virtual void start() const; + virtual void forth() const; + virtual void back() const; + virtual void finish() const; + virtual void move(const int index) const; + virtual void go(const int index) const; + friend const bool operator==(const List& left, + const List& right); + friend const bool operator!=(const List& left, + const List& right); + virtual void put_i_th(const T value, const int index); + virtual void swap(const int index); +}; +typedef int T; +class Array { +private: + int lower_index; + int upper_index; + T *array; +protected: + virtual void allocate(const int minindex, const int maxindex); + virtual void copy(const Array&other); +public: + Array(const int minindex, const int maxindex); + Array(const Array& other); + virtual const int count() const; + virtual const int lower() const; + virtual const int upper() const; + virtual const T item(const int index) const; + const T Array::operator[](const int index); // { dg-error "" } qualification ignored + virtual const bool valid_index(const int index) const; + virtual const bool empty() const; + friend const bool operator==(const Array& left, const Array& right); + friend const bool operator!=(const Array& left, const Array& right); + virtual void put(const T value, const int index); + virtual void wipe_out(); + Array& operator=(const Array& other); + virtual ~Array(); +}; +class Fixed_List: public List, private Array { +protected: + virtual void go_offleft() const; + virtual void go_offright() const; + virtual void copy(const List& other); +public: + Fixed_List(const List& other); + Fixed_List(const int size): Array(1, size) { }; + virtual const bool empty() const; + virtual const int count() const; + virtual const T item() const; + virtual const T i_th(const int index) const; + virtual void move(const int index) const; + virtual void put(const T value); + virtual void put_i_th(const T value, const int index); + virtual void wipe_out() { }; + Fixed_List& operator=(const List& other); +}; + +void Fixed_List::go_offleft() const +{ + cursor_position = 0;// { dg-error "" } +} +
missed-error3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility17.C =================================================================== --- visibility17.C (nonexistent) +++ visibility17.C (revision 816) @@ -0,0 +1,66 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Sandeep Shroff +// Date: Thu, 05 Aug 1993 17:23:20 -0700 +// Subject: Access to private constructor. +// Message-ID: <9308060023.AA10283@neptune.caere.com> +#include +#include + +class Base +{ +public: + char* getName() {return name_;} + +private: + Base(); + Base(char* str); + + char* name_; +}; + +class Derived : public Base +{ +public: + Derived(int n, char* str); + Derived(int n); + + int getNum() {return num_;} +private: + int num_; +}; + +Base::Base() // { dg-error "is private" } +{ + name_ = std::strcpy(new char[std::strlen(" ") + 1], " "); +} + +Base::Base(char* str) // { dg-error "is private" } +{ + if(str != NULL) + name_ = std::strcpy(new char[std::strlen(str) + 1], str); +} + +Derived::Derived(int n, char* str) : Base(str) // { dg-error "within this context" } +{ + num_ = n; +} + +Derived::Derived(int n) : Base() // { dg-error "within this context" } +{ + num_ = n; +} + + + +int main() +{ + // Derived* d = new Derived(10, "test"); + Derived* d = new Derived(10); + + std::cerr << d->getNum() << "\t" << d->getName() << std::endl; +} + + +
visibility17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt22.C =================================================================== --- cvt22.C (nonexistent) +++ cvt22.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <93Aug2.163542pdt.26892@franklin.parc.xerox.com> +// From: Jesse Hull +// Subject: typedef bug +// Date: Mon, 2 Aug 1993 16:35:28 PDT + +typedef int A[10]; + +int main() +{ + int* a1 = new A; +}
cvt22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors16.C =================================================================== --- ctors16.C (nonexistent) +++ ctors16.C (revision 816) @@ -0,0 +1,50 @@ +// { dg-do run } +// GROUPS passed constructors +// ctor file +// Message-Id: <9306021533.AA14347@icepick.jts.com> +// From: roland@jts.com (Roland Knight ) +// Subject: gcc 2.4.1 bug +// Date: Wed, 2 Jun 1993 11:33:34 -0400 + +#include +#include +#include + +char stuff[50]; +char *p = stuff; + +class A { +public: + A() { *p++ = 'A';} +}; + +class B { +public: + B() { *p++ = 'B'; } +}; + +class C : public A, public B { +public: + C() : B(), A() { *p++ = 'C'; } +}; + +class D : public A, public B { +public: + D() : B() { *p++ = 'D'; } +}; + +class E : public A, public B { +public: + E() { *p++ = 'E'; } +}; + + +int main() { + C c; + D d; + E e; + if (strncmp ("ABCABDABE", stuff, 9)) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
ctors16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm4.C =================================================================== --- arm4.C (nonexistent) +++ arm4.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do run } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <199301272139.AA25489@world.std.com> +// From: kol@world.std.com (Nikolay Yatsenko) +// Subject: g++ bug +// Date: Wed, 27 Jan 1993 16:39:10 -0500 + +extern "C" int printf(const char*,...); +int count = 0; + +struct S { + int i; + S(int b) { + i = b; + count++; } +}; + +int main(void) +{ + double a = 2.0; + + S x(int (a)); + if (count > 0) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + return 0; +}
arm4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: inline6.C =================================================================== --- inline6.C (nonexistent) +++ inline6.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed inlining +// inline file +// Message-Id: <199307162240.AA04019@world.std.com> +// From: kol@world.std.com (Nikolay Yatsenko) +// Subject: g++ bug: crash with extern C friend +// Date: Fri, 16 Jul 1993 18:40:48 -0400 + +inline void Ignore(){} + +extern "C" void foo() {} // but without extern C g++ compiles it + +struct A +{ + void f() {Ignore();} + friend void foo (); +};
inline6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors6.C =================================================================== --- ctors6.C (nonexistent) +++ ctors6.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed constructors +#include + +double foo(std::complex *a) +{ + return 0.0; +} + + +double bar(void) +{ + std::complex v[10]; + return foo(v); +}
ctors6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm12.C =================================================================== --- arm12.C (nonexistent) +++ arm12.C (revision 816) @@ -0,0 +1,49 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// From: belley@cae.ca (Benoit Belley 3218) +// Subject: Bad access control with private constructor and derivation +// Date: Fri, 28 May 1993 12:39:57 -0400 (EDT) + +#include + +class X +{ +public: + void f(); + +private: + X(); +}; + +class Y : public X +{ +public: + Y(); +}; + +X::X() // { dg-error "is private" } +{ + std::cout << "X::X()" << std::endl; +} + +void X::f() +{ + std::cout << "X::f()" << std::endl; +} + +Y::Y() // { dg-error "within this context" } +{ + std::cout << "Y::Y()" << std::endl; +} + + +int main() +{ + Y y; + y.f(); +} + + + +
arm12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators22.C =================================================================== --- operators22.C (nonexistent) +++ operators22.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed operators +template +class t { +public: + t() {} +}; + +class m { + t c; +public: + m() : c() {} +}; + +m *p() {return new m;}
operators22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access3.C =================================================================== --- access3.C (nonexistent) +++ access3.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed access +// unsorted.2 file +// Date: Sat, 6 Jun 1992 18:23:03 -0400 +// From: Brendan Kehoe +// Message-Id: <199206062223.AA22653@betty.cs.widener.edu> +// Subject: bug with access control to member functions + + class X { + void g (int); // { dg-error "" } is private + public: + void g (double); + }; + + class Y : public X { void f() { g (1); } };// { dg-error "" } +
access3.C Property changes : Added: svn:eol-style ## -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,18 @@ +// { dg-do assemble } +// GROUPS passed friends +// friends file +// From: rwave!myersn%rwave.roguewave@cs.orst.edu (Nathan Myers) +// Date: Thu, 17 Dec 92 16:33 PST +// Subject: 2.3.2: friend decl of new confuses constructor +// Message-ID: + +#include +#include +struct Foo { + friend void* operator new(size_t) throw (std::bad_alloc); + friend void operator delete(void*) throw (); + Foo(); + ~Foo(); +}; +Foo::Foo() { } +Foo::~Foo() { }
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: nest2.C =================================================================== --- nest2.C (nonexistent) +++ nest2.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed nest +struct B +{ + class B_I { }; +}; + +struct D : public B +{ + B_I foo; + class I : public B_I { }; +}; +
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: visibility26.C =================================================================== --- visibility26.C (nonexistent) +++ visibility26.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: jamshid@ses.com (Jamshid Afshar) +// Date: Sun, 12 Dec 93 03:09:15 CST +// Subject: Missed access declaration error +// Message-ID: <9312120909.AA22135@ses.com> + +class X { + public: + void f(); +}; + +class Y : private X { + public: + void f(int); + X::f; // used to be an error; now equivalent to 'using X::f' +};
visibility26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt14.C =================================================================== --- cvt14.C (nonexistent) +++ cvt14.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9303241504.AA25988@spock.orl.mmc.com> +// Subject: internal compiler error +// Date: Wed, 24 Mar 1993 10:04:06 -0500 +// From: "Malcolm C. Strickland" + + +int main() + { + double *d; + d = new double(10); + return 1; + }
cvt14.C Property changes : Added: svn:eol-style ## -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,31 @@ +// { dg-do run } +// GROUPS passed code-generation +// code-gen file +// From: david.binderman@pmsr.philips.co.uk +// Date: Tue, 17 Aug 93 10:09:38 BST +// Subject: .* broken in 2.4.5 +// Message-ID: <9308170909.AA05509@pmsr.philips.co.uk> + +class A { +public: + char c; +}; + +typedef char A::*PMA; + +PMA pmA = &A::c; + +A oA; + +extern "C" int printf( const char *, ...); + +int main() +{ + oA.c = 'q'; + + if ( (oA .* pmA)) + printf( "PASS\n"); + else + printf(" FAIL\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: temps1.C =================================================================== --- temps1.C (nonexistent) +++ temps1.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed temps +// temps file +// Date: Mon, 07 Sep 1992 13:12:28 EDT +// From: richard@ttt.kth.se +struct foo +{ + char *s; + foo(char *x) { s=x; } +}; + +struct cookie +{ + foo * v; + cookie ( foo * x) { v=x; } +}; + +cookie cat(&foo("apabepa"));// { dg-error "" } .*
temps1.C Property changes : Added: svn:eol-style ## -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,23 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Rob Hasker +// Date: Sat, 3 Apr 1993 13:19:05 -0600 +// Subject: no privacy +// Message-ID: <199304031919.AA20554@sparc17.cs.uiuc.edu +class Top { +public: + Top() {} + void val() {} // { dg-error "" } private base class +}; + +class Derived : private Top { +public: + Derived() {} +}; + +class Unrelated { + Derived derived; +public: + void oops() { derived.val(); }// { 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: except6.C =================================================================== --- except6.C (nonexistent) +++ except6.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// { dg-options "-fexceptions" } +// GROUPS passed exceptions +// except file +// From: GUSTAVO%DRAGON@orion.cpqd.ansp.br +// Date: 15 Dec 1993 09:33:30 +0000 (C) +// Subject: exception handling problem +// Message-ID: <01H6I5GEAF5UPBJ0UV@VENUS.CPQD.ANSP.BR> + +struct Exception + { + int v; + Exception(int i) { v = i; }; + }; + +void inc(int &i) + { + try { + if (i == 0) + throw Exception(i); + else + i++; + } + catch (Exception v) { + i = v.v; + } + }
except6.C Property changes : Added: svn:eol-style ## -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,38 @@ +// { dg-do run } +// GROUPS passed destructors +// dtor file +// Message-Id: <9301242117.AA04053@cs.rice.edu> +// From: dougm@cs.rice.edu (Doug Moore) +// Subject: 2.3.3: premature dtor of temp? +// Date: Sun, 24 Jan 93 15:17:07 CST + +#include +#include + +int killed = 0; + +class Foo +{ + int a; +public: + Foo() + :a(0) {;} + ~Foo() { killed++;} + Foo& operator << (int b) + { + a += b; + if (killed) + { + printf ("FAIL\n"); + exit (1); + } + return *this; + } +}; + +int main() +{ + Foo() << 1 << 3 << 5 << 7; + printf ("PASS\n"); +} +
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: cvt5.C =================================================================== --- cvt5.C (nonexistent) +++ cvt5.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <1992Jul31.142856.10082@ericsson.se> +// From: jonas@ericsson.se (Jonas Nygren) +// Subject: g++ bug +// Date: Fri, 31 Jul 1992 14:28:56 GMT + +class A {}; +class B : public A {}; + +B b; + +class R{ +public: + R() {} + operator B&() { return b; } +}; + +void f(A&) {} + +int main(){ + R r; + + f(r); // problem to cast to B& and then to A& +} + +
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: refs2.C =================================================================== --- refs2.C (nonexistent) +++ refs2.C (revision 816) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// GROUPS passed references +int func(int& i) +{ + static int& v = i; + return v; +} + +int main() +{ +}
refs2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators31.C =================================================================== --- operators31.C (nonexistent) +++ operators31.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-del file +// From: Eberhard Mattes +// Date: Thu, 4 Aug 94 08:19:20 +0200 +// Subject: delete [] A::s +// Message-ID: <9408040619.AA27602@azu.informatik.uni-stuttgart.de> + +class A +{ + char *s; +public: + void f (); +}; + +void A::f () +{ + delete [] A::s; +}
operators31.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators14.C =================================================================== --- operators14.C (nonexistent) +++ operators14.C (revision 816) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed operators +void foo (int * a, int * b, int * c) {} + +int main() { + int a,b,c; + foo (&a, &b, &c); + (a = b) = c; +} +
operators14.C Property changes : Added: svn:eol-style ## -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,22 @@ +// { dg-do assemble } +// GROUPS passed visibility + +#include + +class base { +public: + void f1 () { std::cout << "f1" << std::endl; }; + void f2 () { std::cout << "f2" << std::endl; }; +}; + +class deriv : public base { + void base :: f1();// { dg-error "" } .* +}; + +int main () +{ + deriv d; + + d.f2(); +} +
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,11 @@ +// { dg-do assemble } +// GROUPS passed initialization +class test + { + public: + int x; + int y; + test (int val) { x = val; y = 0;} + }; + +test ar(34)[5];// { dg-error "" } .*
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: missing1.C =================================================================== --- missing1.C (nonexistent) +++ missing1.C (revision 816) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// GROUPS passed missing +// missing file +// Message-Id: <9207100259.AA11702@quaestor> +// From: adam@inference.com (David Adam) +// Subject: G++ does not allow parens around declarators. +// Date: Thu, 9 Jul 92 19:59:51 PDT + +void foo() +{ + long (bar)[5]; +}
missing1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing7.C =================================================================== --- parsing7.C (nonexistent) +++ parsing7.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: szahn%Robinie@goesser.sie.siemens.co.at (Hr. Zahn) +// Date: Mon, 5 Jul 93 10:45:51 +0200 +// Subject: Bug report g++ 2.4.5, unexpected syntax errors +// Message-ID: <9307050845.AA00499@ets5.uebemc.siemens.de> + +int f1( + int (**a1)() + ); + +int f2( + int (**a1)() + ); + + +int f3( + int (**a1)( int a, int b ) + ); + +int f4( + int (**a1)( int a, int b ) + );
parsing7.C Property changes : Added: svn:eol-style ## -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,67 @@ +// { dg-do run } +// GROUPS passed copy-ctors +#include + +int pass = 0; +class name { + int namestuff; +public: + name() { + namestuff = 111; + } + name(const name& subject); + + name & operator = (const name& right) { + this->namestuff = right.namestuff; + return *this; + } + + ~name() { + ; + } +}; + +name::name(const name& subject) { + pass = 1; +} + +class person { + int personstuff; + name personname; +public: + person() { + ; + personstuff = 222; + } + ~person() { + ; + } + void print() { + ; + } + +}; + +void +test(person argp) +{ + person testp; + + ; + argp.print(); + testp = argp; + argp.print(); + testp.print(); + ; +} + +int main() +{ + person mainp; + test(mainp); + if (pass) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +} +
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,22 @@ +// { dg-do assemble } +// GROUPS passed scoping +// local-class file +// From: dcb@us-es.sel.de +// Date: Fri, 27 Nov 92 15:34:28 +0100 +// Subject: GNU G++ 2.3.1 bug report +// Message-ID: <9211271434.AA15612@us-es.sel.de> + + +void f() +{ + { + struct A { + A() {}; + } a; + }; + { + struct A { + A() {}; + } 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: arg6.C =================================================================== --- arg6.C (nonexistent) +++ arg6.C (revision 816) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <9305032310.AA03900@malachite.bbn.com> +// From: Dan Franklin +// Subject: overloaded function bug +// Date: Mon, 3 May 93 19:10:10 EDT + + + typedef int (*fnp)(int, void*); + void dispatch_insert(int, int, fnp, void* = 0); + void dispatch_insert(int, int, long*, char*); + typedef void (*InsertFunP)(int, int, fnp, void*); + extern void f(InsertFunP); + void g() { f(dispatch_insert); }
arg6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: casts2.C =================================================================== --- casts2.C (nonexistent) +++ casts2.C (revision 816) @@ -0,0 +1,39 @@ +// { dg-do assemble } +// GROUPS passed casts +class VObject; + +typedef int boolean; + +typedef boolean (VObject::*method)(); +typedef boolean (VObject::*method0)(); +typedef boolean (VObject::*method1)(long); + +#define methodOf(o,m) (method)(&o::m) + + +class VObject { + public: + boolean perform(method ); + boolean perform(method , long); + void affectMethod(method ); + void dummy(){}; +}; + + +boolean VObject::perform(method m) +{ + method0 q = (method0)m; + return(this->*q)(); +} + + +boolean VObject::perform(method m, long param) +{ + method1 q = (method1)m; + return(this->*q)(param); + } + +void VObject::affectMethod(method m) +{ + m = methodOf(VObject, dummy); +}
casts2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility18.C =================================================================== --- visibility18.C (nonexistent) +++ visibility18.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: cmwang@iis.sinica.edu.tw (Chien-Min Wang) +// Date: Fri, 6 Aug 93 19:42:31 CST +// Subject: A bug in g++ 2.4.5 +// Message-ID: <9308061142.AA08533@iiserv> +struct T1 { int i; }; + +struct T2 { int j; }; // { dg-error "" } private + +struct T3 : public T1, private T2 { +} x; + +int main () +{ + x.i = 1; + x.j = 2; // error: x.j is private// { dg-error "" } .* + return 0; +}
visibility18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt23.C =================================================================== --- cvt23.C (nonexistent) +++ cvt23.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9308051209.AA15962@NeoSoft.Com> +// From: daniels@sugar.neosoft.com (Brad Daniels) +// Subject: Bug in g++ 2.4.5: Conversion operators to enumerated types don't wor +// Date: Thu, 5 Aug 93 12:09:09 CDT + +enum bar { AAA, BBB }; + +class foo { + bar a, b; +public: + foo(bar i, bar j) : a(i),b(j) {} + operator const bar() const { return a; } + bar f() { return *this; } + void g(foo &c) { b = c; } +};
cvt23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors17.C =================================================================== --- ctors17.C (nonexistent) +++ ctors17.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: <199306151813.gD28471@mail.Germany.EU.net> +// From: stephan@ifconnection.de (Stephan Muehlstrasser) +// Subject: gcc 2.4.3.1: illegal constructor call not rejected +// Date: Tue, 15 Jun 1993 18:34:14 +0200 (MET DST) + + +#include + +class X : public std::ifstream { // { dg-error "" } candidate + public: + X(int a, const char *b) {} // { dg-error "" } candidate +}; +int main() +{ + X *y = new X(10, "123"); + // the compiler must reject this constructor call: + X *x = new X("abc");// { dg-error "" } .* +}
ctors17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm5.C =================================================================== --- arm5.C (nonexistent) +++ arm5.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <9212072127.AA24243@us-es.sel.de> +// From: dcb@us-es.sel.de +// Subject: page 78 of the ARM +// Date: Mon, 7 Dec 92 22:27:09 +0100 + +extern "C" int printf( const char *, ...); + +int & max( int & a, int & b) { + return (a < b) ? b : a; +} + +int main( void) { + int a = 1; + int b = 2; + int & c = max( a, b); + + if (&c == &b) + printf( "PASS\n"); + else + { printf( "FAIL\n"); return 1; } + return 0; +}
arm5.C Property changes : Added: svn:eol-style ## -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,24 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-as file +// From: Klaus Ahrens +// Date: Fri, 26 Mar 93 12:50:37 mez +// Subject: no default assignment +// Message-ID: <199303261149.TA23114@mail.Germany.EU.net> + +class A { +public: + A(int){} + A& operator=(const A&){return *this;} +}; + +class B: public A { +public: + B(int i): A(i) {} +}; + +int main() +{ + B b=1; + b=1; +}
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: inline7.C =================================================================== --- inline7.C (nonexistent) +++ inline7.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed inlining + template +struct A { + typedef int X; + A() {} + virtual ~A() { } +}; + template +struct B : public A { + B() { } +}; +B::X x;
inline7.C Property changes : Added: svn:eol-style ## -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,20 @@ +// { dg-do run } +// GROUPS passed initialization +// init file +// Message-Id: <9306280834.AA20921@slsvitt.us-es.sel.de> +// From: David Binderman 3841 +// Subject: Page 289 of the ARM +// Date: Mon, 28 Jun 93 10:34:37 +0200 + +struct T { + int m; + + T( int g):m(g){} +}; + +// T s1[2][2] = {1,2,3,4}; + +int main() { + T s1[2][2] = {1,2,3,4}; + return 0; +}
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: ctors7.C =================================================================== --- ctors7.C (nonexistent) +++ ctors7.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctors file +// Message-Id: <3JUL199214462623@envmsa.eas.asu.edu> +// From: peckham@envmsa.eas.asu.edu (Bill) +// Subject: const constructor causes crash +// Date: Fri, 3 Jul 1992 21:46:00 GMT + +class base_t { +public: + virtual const char* name () { return "base_t"; } + + base_t (); + virtual ~base_t (); +}; + +class d1_t : public base_t { +public: + virtual const char* name () { return "d1_t"; } + + // The const keyword on this constructor is an error, but it shouldn't + // cause the compiler to crash. + + d1_t () const;// { dg-error "" } .*const.* + virtual ~d1_t (); +}; + +class d2_t : public base_t { +public: + virtual const char* name () { return "d2_t"; } + + d2_t (int); + virtual ~d2_t (); +}; +
ctors7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vbase1.C =================================================================== --- vbase1.C (nonexistent) +++ vbase1.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// GROUPS passed vbase +// vbase file +// From: pino@hubble.eecs.berkeley.edu (Jose Luis Pino) +// Date: 28 Jul 1994 05:17:39 GMT +// Subject: g++ 2.6 bug: virtual base class & protected methods +// Message-ID: <317f1j$o9c@agate.berkeley.edu> + + +#include + +class a { +protected: + virtual void foo() { std::cout << "Class A\n";} +}; + +class b : public virtual a {}; + +class c : public b { +public: + void bar() { b::foo();} +}; + +int main() { + c test; + test.bar(); +} + +
vbase1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: global-init1.C =================================================================== --- global-init1.C (nonexistent) +++ global-init1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do run } +// GROUPS passed initialization +// global-init file +// Message-Id: <9212021756.AA12639@grumpy.pocs.com> +// From: wp@pocs.com (Wolfgang Polak) +// Subject: Initializers - gcc 2.2.2 (g++), SPARC, SunOS 4.1.1 +// Date: Wed, 2 Dec 92 09:56:01 PST + +#include +struct S { int a; int c; }; +int i = 3; +S s = {6, i}; +S * the_s () { return &s; } +int main () +{ + S * cls = the_s (); + if (cls->a != 6) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
global-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: arm13.C =================================================================== --- arm13.C (nonexistent) +++ arm13.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do run } +// GROUPS passed ARM-compliance +#include +#include + +inline void *operator new(size_t, void *place) { return place; } + +int main() +{ + int* p = (int*) malloc(sizeof(int)); + (void) new (p) int(1); + typedef int I; + p->I::~I(); + free(p); + printf ("PASS\n"); +}
arm13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators23.C =================================================================== --- operators23.C (nonexistent) +++ operators23.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do run } +// GROUPS passed operators +// opr-new file +// From: (The Crossjammer) +// Date: Mon, 23 Nov 92 23:35:26 PST +// Subject: g++-2.3.1 : Incorrectly calls overloaded operator new +// Message-ID: <9211240735.AA06872@cork.CS.Berkeley.EDU> + + +#include +#include + +class blah { + int j; + public: + blah(); + void *operator new(size_t size) throw(); +}; + +inline blah::blah() : j(0) { + +} + + +void *blah::operator new(size_t size) throw(){ + printf ("FAIL\n"); + exit (1); + return NULL; +} + +int main(int arg, char** argv) { + blah* blahPtr; + + blahPtr = new blah[100]; + printf ("PASS\n"); +}
operators23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access4.C =================================================================== --- access4.C (nonexistent) +++ access4.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed access +// (Message bugs/access:3) +// From: jamshid@ses.com (Jamshid Afshar) +// Date: Wed, 2 Mar 94 18:24:22 CST +// Subject: g++ 2.5.5 doesn't warn about inaccessible virtual base ctor +// Message-ID: <9403030024.AA04534@ses.com> + +class ForceLeafSterile { // { dg-error "" } + friend class Sterile; + ForceLeafSterile() {} // { dg-error "" } +}; + +class Sterile : private virtual ForceLeafSterile { +public: + Sterile() {} + Sterile(const char* /*blah*/) {} +}; + +class Illegitimate : public Sterile { +public: + Illegitimate() {} // { dg-error "" } can't access virtual base deflt ctor + Illegitimate(const char* /*blah*/) + : ForceLeafSterile() {} // { dg-error "" } can't access default ctor + Illegitimate(const Illegitimate&) + {} // { dg-error "" } can't access default ctor +};
access4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static-mem2.C =================================================================== --- static-mem2.C (nonexistent) +++ static-mem2.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed static-mem + +class desc; + +class a_desc { + public: + + static desc the_desc; + + virtual desc *get_desc(); +}; + +class desc : public a_desc { + public: + + static desc the_desc; + + desc(int); + + desc *get_desc(); +}; + + +desc desc::the_desc(1); + +desc a_desc::the_desc(0);
static-mem2.C Property changes : Added: svn:eol-style ## -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,19 @@ +// { dg-do assemble } +// GROUPS passed enums +// enum file +// From: polstra!jdp@uunet.uu.net (John Polstra) +// Date: Mon, 15 Nov 93 12:14 PST +// Subject: GCC 2.5.3 Enum Bitfield Causes Bogus Warning +// Message-ID: + + enum Color { Red, Green, Blue }; + + struct S { + Color c : 8; + } s; + + void foo() + { + s.c = Red; // <== This statement produces the warning message. + } +
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,25 @@ +// { dg-do assemble } +// GROUPS passed nest +#include + +struct inner { + static void f() { std::cout << "inner::f()\n";} +}; + +struct outer { + + struct inner { + static void f() { std::cout << "outer::inner::f()\n";} + }; + + static void f() { + inner::f(); //call of outer::inner::f() + ::inner::f(); //(try to) call inner::f() => parse error + } +}; + +int main() { + outer::f(); + std::cout << std::endl; + return 0; +}
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: pic1.C =================================================================== --- pic1.C (nonexistent) +++ pic1.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// GROUPS passed operators +// pic file +// Message-Id: <199406132030.NAA23508@dewitt.eecs.berkeley.edu> +// Subject: gcc-2.5.8 -fpic fails to compile extern const char static initializer +// Date: Mon, 13 Jun 1994 13:30:14 -0700 +// From: Christopher Hylands + +extern const char SDFdomainName[] = "SDF";
pic1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bad-error3.C =================================================================== --- bad-error3.C (nonexistent) +++ bad-error3.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed bad-errors +// bad-error file +// Date: Sun, 31 Jul 1994 11:37:43 +1000 (EST) +// From: Rohan LENARD +// Subject: g++-2.6.0 gives wrong warning for placement syntax new +// Message-Id: <0iCk1b0000000z0VY0@iassf.easams.com.au> + + +#include + +void * operator new(size_t, int *); +void * operator new(size_t, void *); + +int *x = 0; +int foo(){ +new (x) int *; +new (&x) int *; +new (x) int *; // This is identical to line 8 !!! +return 1; +}
bad-error3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility27.C =================================================================== --- visibility27.C (nonexistent) +++ visibility27.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: jbuck@synopsys.com (Joe Buck) +// Date: 3 Aug 1994 01:52:04 GMT +// Subject: 2.6.0 bug with protected members and virtual baseclasses +// Message-ID: <31mt84$lfq@hermes.synopsys.com> + +struct R { +protected: + virtual void foo(); +}; + +struct A : public R { +}; + +struct B : virtual public A { + void bletch() { foo();} +};
visibility27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt15.C =================================================================== --- cvt15.C (nonexistent) +++ cvt15.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9308051530.AA05922@NeoSoft.Com> +// From: daniels@sugar.neosoft.com (Brad Daniels) +// Subject: g++ 2.4.5: Conversion operators to complex types don't work either +// Date: Thu, 5 Aug 93 15:30:04 CDT + +class bar { int x; public: bar() : x(1){} }; + +class foo { + bar a, b; +public: + foo(bar i, bar j) : a(i),b(j) {} + operator const bar() const { return a; } + const bar f() { return *this; } + void g(foo &c) { b = c; } +};
cvt15.C Property changes : Added: svn:eol-style ## -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-gen5.C =================================================================== --- code-gen5.C (nonexistent) +++ code-gen5.C (revision 816) @@ -0,0 +1,287 @@ +// { dg-do run } +// GROUPS passed code-generation +// code-gen file +// From: "David" +// Date: Mon, 15 Nov 1993 20:59:14 -0600 (CST) +// Subject: An error! +// Message-ID: <9311160259.AA03353@pi14.arc.umn.edu> + +#include +#include +#include +#include +#include +#include + +#define ANSI_C + +typedef double VEC ; + +class Vector; + +class VectorInt +{ + public: + + /* Nothing public!! Only Vector can use this class */ + + private: + + VectorInt( int ); + VectorInt( int, double *, int = 0 ); + VectorInt( const VectorInt & ); + ~VectorInt(); + + VectorInt *refer(); + void unrefer(); + int count; /* Number of Vector's referring to me */ + + VEC *vec; + + friend class Vector; + friend class VecElem; +}; + +class VecElem +{ + public: + + operator double(); + double operator=( double ); + + private: + + VecElem( Vector &, int ); + VecElem( const VecElem & ); + + Vector &v; + int row; /* Row element refers to */ + + friend class Vector; +}; + +class Vector +{ + public: + + Vector(); // Must be assigned to before used + Vector( VectorInt * ); + Vector( int ); + Vector( int, double *, int beg = 0 ); + Vector( const Vector & ); + Vector &operator=( const Vector & ); + ~Vector() { if(r) r->unrefer(); }; + + int row() const { return 19; } + int dim() const { return 10; } + + double operator()( int ) const; + VecElem operator()( int ); + + double assign( int, double ); + + friend std::ostream& operator<<(std::ostream&, const Vector& m ); + + private: + + VectorInt *r; /* Reference to real data */ + + friend class VecElem; + friend class LUDecom; + friend class SVD; +}; + + +Vector:: +Vector() + : r(0) +{} + +Vector:: +Vector( VectorInt *vi ) + : r(vi) +{ + r->refer(); +} + +Vector:: +Vector( int row ) +{ + assert( row > 0 ); + + r = new VectorInt( row ); + + r->refer(); +} + +Vector:: +Vector( int row, double *d, int beg ) +{ + assert( row > 0 ); + + r = new VectorInt( row, d, beg ); + + r->refer(); +} + +Vector:: +Vector( const Vector &A ) + : r( A.r->refer() ) +{} + +Vector& Vector:: +operator=( const Vector &A ) +{ + if( r ) + r->unrefer(); + + r = A.r->refer(); + + return *this; +} + +double Vector:: +operator()( int row ) const +{ + assert(r != 0); + + return *r->vec; +} + +VecElem Vector:: +operator()( int r ) +{ + assert(r != 0); + + return VecElem( *this, r ); +} + + /* assign changes the matrix, it does not create a new one! */ +double Vector:: +assign( int rownum, double d ) +{ + assert(r != 0); + + if( rownum > row() || rownum <= 0 ) { + std::cerr << "Warning: trying to assign out of bounds" << std::endl; + std::cerr << "row " << rownum << std::endl; + std::cerr << "Vector size " << row() << std::endl; + std::abort(); + } + + if( r->count == 1 ) { + /* Don't need to create a new matrix, since we are the only */ + /* one pointing to ours */ + } + else { + VectorInt *vi = new VectorInt( *r ); + r->unrefer(); + r = vi->refer(); + } + + return d; +} + + +VectorInt:: +VectorInt( int sx ) + : vec( new double[sx] ), count(0) +{ } + +VectorInt:: +VectorInt( int sx, double *, int ) + : vec( new double[sx] ), count(0) +{ +} + +VectorInt:: +VectorInt( const VectorInt & ) + : vec( new double[10] ), count(0) +{ +} + +VectorInt * VectorInt:: +refer() +{ + count ++; + return this; + + // cout << "Refering vec" << endl; +} + +void VectorInt:: +unrefer() +{ + count--; + + if( count == 0 ) { + delete this; + } + + // cout << "Unrefering vec" << endl; +} + +VectorInt:: +~VectorInt() +{ + delete vec; + vec = 0; +} + +VecElem:: +VecElem( Vector &vec, int r ) + : v(vec), row(r) +{ + if( r < 1 || r > vec.row() ) { + std::cerr << "Trying to access vector element out of bounds"; + std::cerr << std::endl; + std::abort(); + } +} + +VecElem:: +VecElem( const VecElem &elem ) + : v(elem.v), row(elem.row) +{} + +VecElem:: +operator double() +{ + assert( v.r->vec != 0 ); + return *v.r->vec; +} + +double VecElem:: +operator=( double d ) +{ + return v.assign( row, d ); +} + + + + + +int makeforms( Vector cen, Vector **a, Vector **b ); + +int main() +{ + Vector *a[8], *b[8], disp(3); + Vector cen(3), cen2(3); + int i, j; + + if (makeforms (cen,a,b) != 10) + { std::printf ("FAIL\n"); return 1; } + else + std::printf ("PASS\n"); + + +} + +int +makeforms( Vector cen, Vector **a, Vector **b) +{ + return 10; +} + + +
code-gen5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temps2.C =================================================================== --- temps2.C (nonexistent) +++ temps2.C (revision 816) @@ -0,0 +1,55 @@ +// { dg-do run } +// GROUPS passed temps +// temps file +// Message-Id: <9212181914.AA05066@sparc1.cnm.us.es> +// From: juando@cnm.us.es (Juan Domingo Martin Gomez) +// Subject: Temporaries destroyed too soon +// Date: Fri, 18 Dec 92 20:14:45 +0100 + +#include + +int status = 0; +int fail = 0; + +class Foo +{ +public: + Foo(); + ~Foo(); + + Foo &method(); +}; + +Foo f1() +{ + return Foo(); +} + +Foo::Foo() +{ +} + +Foo::~Foo() +{ + if (status == 2) + fail = 0; + else + fail = 1; +} + +Foo &Foo::method() +{ + status++; + return *this; +} + +int main() +{ + // f1() returns a temporary object. The member function + // method() returns a reference to the same object. + f1().method().method(); + if (fail) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
temps2.C Property changes : Added: svn:eol-style ## -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,73 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Gordon Joly +// Date: Wed, 21 Apr 93 09:42:07 +0100 +// Subject: /*** BUG REPORT : THE MYTH OF PRIVATE INHERITANCE ***/ +// Message-ID: <9304210842.AA01815@life.ai.mit.edu> +#include + +class A { + private: + int number; + public: + A(int i) : number(i) + {} + virtual ~A() + {} + virtual void Number(int c) // { dg-error "inaccessible" } + { number = c; } + virtual int Number() // { dg-error "inaccessible" } + { return number; } +}; + +class B : private A { + private: + int second_number; + public: + B(int c, int i) : second_number(c), A(i) + {} + virtual ~B() + {} + + virtual void firstNumber(int b) // renames member function Number(int) of class A + { A::Number(b); } + virtual int firstNumber() // renames member function Number() of class A + { return A::Number(); } +}; + + + + +class C { + private: + B* bobject; + public: + C(B* bp) : bobject(bp) + {} + virtual ~C() + {} + // + // the following two functions access + // private member functions of class B + // and they should not be able to do so + // + virtual void setBValue(int i) + { if (bobject) bobject->Number(i); } // { dg-error "this context|accessible base" } + virtual int getBValue() + { if (bobject) { return bobject->Number(); } return 0; } // { dg-error "this context|accessible base" } +}; + + +int main() +{ + B* bobject = new B(2, 1); + C* cobject = new C(bobject); + cobject->setBValue(8); + std::cout << cobject->getBValue() << std::endl; + delete bobject; + delete cobject; +} + + +
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: dtors4.C =================================================================== --- dtors4.C (nonexistent) +++ dtors4.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do run } +// GROUPS passed destructors +#include + +int destruct = 2; + +class a { + public: + char *p; + a(){ ; } + ~a(){ destruct--; if (! destruct) printf ("PASS\n");} +}; + +a test(){ + return a(); +} + +int main(){ + a ai; + + ai = test(); +} +
dtors4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt6.C =================================================================== --- cvt6.C (nonexistent) +++ cvt6.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9208261851.AA16997@josquin.media.mit.edu> +// From: bilmes@media.mit.edu +// Subject: gcc (g++) 2.2.2 constructing nested class from external scope +// Date: Wed, 26 Aug 92 14:51:17 -0400 + + +class foo { + + class bar { + int i; + public: + bar(int j) { i = j; } + }; + + bar b; +public: + foo() : b(3) {} + void test(bar lb) { b = lb; } +}; + + +int main() { + foo f; + f.test(34); // line 18 +}
cvt6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: refs3.C =================================================================== --- refs3.C (nonexistent) +++ refs3.C (revision 816) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// GROUPS passed references +const int& min(const int& n, const int& m) +{ + return n < m ? n : m; +}
refs3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators32.C =================================================================== --- operators32.C (nonexistent) +++ operators32.C (revision 816) @@ -0,0 +1,55 @@ +// { dg-do assemble } +// GROUPS passed operators +#include + +// +// ffrees space allocated for N-D array +// + +template +void ffree(long rows, T** array) +{ +for( long i = 0; i < rows; i++ ) + delete [] array[i]; // delete row +delete [] array; // delete outer array +} + +template +T* allocate1d(long size, T*& array) +{ +return array = new T[size]; +} + +template +T** allocate2d(long d1, long d2, T**& array) +{ +if( allocate1d(d1, array) != 0 ) + { + for( long i = 0; i < d1; i++ ) + { + if( allocate1d(d2, array[i]) == 0 ) + { + ffree(i,array); + return array; + } + } + } +return array; +} + +int main() +{ +long d1 = 3, d2 = 4; +class foo +{ +public: +foo() {std::cout << "foo created" << std::endl; } + +~foo() {std::cout << "foo deleted" << std::endl; } +}; + +foo **f2; +allocate2d(d1, d2, f2);// { dg-error "" } type.*// ERROR - trying to.* +ffree(d1, f2);// { dg-error "" } type.*// ERROR - trying to.* + +}
operators32.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators15.C =================================================================== --- operators15.C (nonexistent) +++ operators15.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do run } +// GROUPS passed operators +// opr-del file +// Message-Id: <199301272137.AA25213@world.std.com> +// From: kol@world.std.com (Nikolay Yatsenko) +// Subject: bug report +// Date: Wed, 27 Jan 1993 16:37:30 -0500 + +extern "C" int printf(const char* ...); + +int delete_counter = -1; + +struct T{ + void operator delete (void * p) {delete_counter ++; ::operator delete(p);} +}; + +int main(void) +{ + T * ps1 = new T; + + ::delete ps1; // Wrong T::operator delete() is called here + + if (delete_counter != -1) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); + return 0; +}
operators15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility11.C =================================================================== --- visibility11.C (nonexistent) +++ visibility11.C (revision 816) @@ -0,0 +1,52 @@ +// { dg-do assemble } +// { dg-options "-w" } +// GROUPS passed visibility +// visibility file +// From: Alan Shepherd +// Date: Tue, 22 Jun 1993 14:53:23 +0100 +// Subject: bug with MI in gcc-2.4.5 +// Message-ID: <9659.740757203@nexor.co.uk> + +class A +{ + int a; + +protected: + + virtual void State(int b) { a = b; } + +}; + +class B : public A +{ + char* foo; + +public: + + B(const char*); +}; + +class C : public A +{ + char* foo2; + +public: + + C(const char*); +}; + +class D : public B, public C +{ +public: + D(); +protected: + + virtual void State(int a) + { + B::State(a); + C::State(a); + } +}; + + +
visibility11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors10.C =================================================================== --- ctors10.C (nonexistent) +++ ctors10.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: <9302052351.AA10789@harvey> +// From: greg@qualcomm.com (Greg Noel) +// Subject: bug019.cc +// Date: Fri, 5 Feb 93 15:51:42 -0800 + +#include + +class Klasse +{ + class Err : public std::ostream + { + public: + Err(void) : std::ostream(NULL) { } + ~Err(void) { } + }; +public: + //template Err& operator << (const T x) { return Err() << x; } + Err& operator << (const char *x) { return Err() << x; }// { dg-error "" } .* +private: + char x; +};
ctors10.C Property changes : Added: svn:eol-style ## -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,22 @@ +// { dg-do assemble } +// GROUPS passed initialization +// init file +// From: kol@world.std.com (Nikolay Yatsenko) +// Date: Wed, 27 Jan 1993 16:39:13 -0500 +// Subject: g++ bug +// Message-ID: <199301272139.AA25514@world.std.com> + + +const int ic = 1; +void f(int& arg) // { dg-error "passing argument 1" } +{ + if (arg) ; +} +const int& icr = ic; + +int main(void) +{ + f(icr); // { dg-error "invalid initialization" } + + return 0; +}
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: parsing8.C =================================================================== --- parsing8.C (nonexistent) +++ parsing8.C (revision 816) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: nag@soft.flab.fujitsu.co.jp +// Date: Thu, 08 Jul 1993 10:54:59 +0900 +// Subject: g++ cannot understand `void (**f)()' +// Message-ID: <9307080155.AA00496@kumade.soft.flab.fujitsu.co.jp> + + void + func() { + int ( * * i )[ 2 ]; + } + +// Looks like this is probably the same problem +// parsing folder +// From: nag@soft.flab.fujitsu.co.jp +// Date: Thu, 08 Jul 1993 10:54:59 +0900 +// Subject: g++ cannot understand `void (**f)()' +// Message-ID: <9307080155.AA00496@kumade.soft.flab.fujitsu.co.jp> +int main() +{ + void (**f)(); +} + + +// Same as +// From: Chris Dodd +// Date: Fri, 16 Jul 93 17:05:04 -0700 +// Subject: bug in declaration parsing in g++ 2.4.5 +// Message-ID: <9307170005.AA03857@pekoe.csl.sri.com> +
parsing8.C Property changes : Added: svn:eol-style ## -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,35 @@ +// { dg-do assemble } +// GROUPS passed copy-ctors +// copy file +// From: Vivek Khera +// Date: Mon, 15 Nov 1993 16:02:18 -0500 +// Subject: g++ 2.5.3 fails to automatically generate default initializer +// Message-ID: <9311152102.AA21248@thneed.cs.duke.edu> + +class String +{ + private: + char a[100]; + int len; + public: + String(); +}; + +String::String() +{ + len = 0; +} + + +struct List +{ + String item[100]; + int num_items; +// List(); // uncomment this line to let compile work +}; + +int +main(int argc, char **argv) +{ + List a; +}
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,16 @@ +// { dg-do assemble } +// GROUPS passed scoping +// local-class file +// From: daniels@sugar.neosoft.com (Brad Daniels) +// Date: Thu, 5 Aug 93 15:36:36 CDT +// Subject: Bug in g++ 2.4.5: Can't touch nested class identifier inside its members +// Message-ID: <9308051536.AA06115@NeoSoft.Com> + +void f() { + class foo { + int x; + public: + foo() : x(1) {} + int bar() { foo p; return p.x; } + }; +}
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,17 @@ +// { dg-do assemble } +// GROUPS passed templates +template< class R, class T1 = R, class T2 = T1 > +struct plus + { + R operator()( const T1& x, const T2& y ) const + { + return x + y; + } + }; + +int +main() + { + plus< int > p; + 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: arg7.C =================================================================== --- arg7.C (nonexistent) +++ arg7.C (revision 816) @@ -0,0 +1,33 @@ +// { dg-do run } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <9305041759.AA04913@malachite.bbn.com> +// From: Dan Franklin +// Subject: overloaded function resolved incorrectly +// Date: Tue, 4 May 93 13:59:18 EDT + +#include + +// Given the following overloaded function definitions + +int ovf(unsigned long, short, short) { printf ("PASS\n"); return 0; } +int ovf( int, short, unsigned long) { printf ("FAIL\n"); return 1; } + +// and the call +// +// ovf(unsigned long, unsigned int, unsigned int) +// +// it seems to me (and to cfront) that this should resolve to ovf #1 above, +// but g++ resolves it to ovf #2. Resolving to ovf #1 requires two conversions +// (unsigned int => short) while resolving to ovf #2 takes two conversions +// (unsigned long => int, unsigned int => short) and a promotion +// (unsigned int => unsigned long). + +int main(int, char**) +{ + unsigned long pixmap = 0; + unsigned int x = 0; + unsigned int y = 0; + + return ovf(pixmap, x, y); +}
arg7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: casts3.C =================================================================== --- casts3.C (nonexistent) +++ casts3.C (revision 816) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed casts +// casts file +// From: fjh@cs.mu.oz.au +// Message-Id: <9310121939.29641@munta.cs.mu.OZ.AU> +// Subject: should emit diagnostic for `int *p = (void *)0;' +// Date: Wed, 13 Oct 93 5:39:35 EST + int *p = (void *)0;// { dg-error "" } .*
casts3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility19.C =================================================================== --- visibility19.C (nonexistent) +++ visibility19.C (revision 816) @@ -0,0 +1,40 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: mclaugh@tnt.acsys.com (Mark A. McLaughlin) +// Date: Wed, 25 Aug 93 14:30:47 MDT +// Subject: g++ bug +// Message-ID: <9308252030.AA02352@tnt.acsys.com> +class B { +protected: + int i; // { dg-error "" } protected +}; + +class D1 : public B { +}; + +class D2 : public B { + friend void fr(B*,D1*,D2*); + void mem(B*,D1*); +}; + +void fr(B* pb, D1* p1, D2* p2) +{ + pb->i = 1; // illegal// { dg-error "" } .* + p1->i = 2; // illegal// { dg-error "" } .* + p2->i = 3; // ok (access through D2) +} + +void D2::mem(B* pb, D1* p1) +{ + pb->i = 1; // illegal// { dg-error "" } .* + p1->i = 2; // illegal// { dg-error "" } .* + i = 3; // ok (access through `this') +} + +void g(B* pb, D1* p1, D2* p2) +{ + pb->i = 1; // illegal// { dg-error "" } .* + p1->i = 2; // illegal// { dg-error "" } .* + p2->i = 3; // illegal// { dg-error "" } .* +}
visibility19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors18.C =================================================================== --- ctors18.C (nonexistent) +++ ctors18.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// GROUPS passed constructors +class test1 { +}; + +template +class GC_PTR { +public: + GC_PTR(T &a) {} +}; + + +void +gotPtrs(GC_PTR r1) +{ +} + +static void +short_alloc(int n) +{ + test1 here; + GC_PTR foo = here; // This works fine. + + gotPtrs(here); // Compile error from this + // No constructor named `GC_PTR` in visible scope + // conversion between incompatible aggregate types requested +}
ctors18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm6.C =================================================================== --- arm6.C (nonexistent) +++ arm6.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// arm file +// Message-Id: <9211231051.AA11287@us-es.sel.de> +// From: dcb@us-es.sel.de +// Subject: ARM page 87 +// Date: Mon, 23 Nov 92 11:51:38 +0100 + + +int main() { + int a; + + switch (a) { + case 1: + int v2 = 3;// { dg-error "" } crosses.* + case 2:// { dg-error "" } jump.* + if (v2 == 7) // error not flagged by 2.3.1 + ; + } + + return 0; +} +
arm6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init14.C =================================================================== --- init14.C (nonexistent) +++ init14.C (revision 816) @@ -0,0 +1,27 @@ +// { dg-do run } +// GROUPS passed initialization +// init file +// From: hansen@srd.ull.rdc.toshiba.co.jp +// Message-Id: <9312130927.AA08192@VLCS151.noname> +// Subject: g++ Bug +// Date: Mon, 13 Dec 93 18:27:51 +0900 + +#include + +int X = 7; + +struct foo { + int a,b,c; +}; + +struct foo Ack = {5, X, 3}; + +int main() +{ + if (Ack.a != 5 + || Ack.b != 7 + || Ack.c != 3) + { printf ("FAIL\n"); return 1; } + else + printf ("PASS\n"); +}
init14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arg10.C =================================================================== --- arg10.C (nonexistent) +++ arg10.C (revision 816) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// arg-matching file +// From: Terry Lee +// Date: Sat, 14 May 1994 02:46:15 -0500 +// Subject: g++ 2.5.8 template bug +// Message-ID: <199405140746.AA03993@uivlsisd.csl.uiuc.edu> + +template +class A { +public: + void func(const T& val) { } +}; + +int main() +{ + A a; + int* ptr = 0; + a.func(ptr); +}
arg10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors8.C =================================================================== --- ctors8.C (nonexistent) +++ ctors8.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed constructors +// ctor file +// Message-Id: <199212160609.AA18247@phecda.cs.sfu.ca> +// From: Taj Khattra +// Subject: gcc 2.3.1 global ctor bug ? +// Date: Tue, 15 Dec 92 22:09:37 PST + +#include + +struct foo { + foo() : index(-1) {} + int index; +}; + +foo *arr = new foo[2]; + +int main() +{ + if (arr[0].index == -1 + && arr[1].index == -1) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
ctors8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm14.C =================================================================== --- arm14.C (nonexistent) +++ arm14.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed ARM-compliance +// unsorted.2 file +// Message-Id: +// Date: Thu, 4 Jun 1992 15:07:56 GMT +// Subject: access control +// From: gjditchf@plg.waterloo.edu (Glen Ditchfield) + + +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 "" } Should be rejected, and is. + } +
arm14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators24.C =================================================================== --- operators24.C (nonexistent) +++ operators24.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-new file +// From: rwave!myersn%rwave.roguewave@cs.orst.edu (Nathan Myers) +// Date: Wed, 16 Dec 92 11:55 PST +// Subject: 2.3.2: friend decl breaks member op new +// Message-ID: + +#include +struct Link { + void* operator new(size_t, int); + friend void* __builtin_new(size_t); // This declaration triggers the bug +}; +void f() { new(2) Link; }
operators24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access5.C =================================================================== --- access5.C (nonexistent) +++ access5.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed access +// access file +// From: Jeffrey C. Gealow +// Date: Thu, 18 Feb 93 10:22:23 -0500 +// Subject: nested class access control bug +// Message-ID: <9302181522.AA29209@mtl.mit.edu> + + +class enclose { +public: + class nested_public { int x; }; +protected: + class nested_protected { int x; }; +private: + class nested_private { int x; }; // { dg-error "" } private +}; + +class derived : public enclose { + nested_public obj1; // ok + nested_protected obj2; // ok + nested_private obj3; // error// { dg-error "" } in this context +}; +
access5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static-mem3.C =================================================================== --- static-mem3.C (nonexistent) +++ static-mem3.C (revision 816) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// GROUPS passed static-mem +// static-mem file +// Message-Id: <9406021639.AA00789@oz.NeXT.COM> +// From: Sumana Srinivasan +// Date: Thu, 2 Jun 94 09:39:09 -0700 +// Subject: static members function pointers + +class CRTFooBar; + +class CRTFoo { +public: + static const CRTFooBar & defaultFooBar( ); + + CRTFoo( const CRTFoo & ); + CRTFoo( ); + CRTFoo( const char *, + const CRTFooBar &tp = CRTFoo::defaultFooBar(), + int = 0 ); + CRTFoo &setFoo( double, + const CRTFooBar & = CRTFoo::defaultFooBar() ); + +};
static-mem3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility20.C =================================================================== --- visibility20.C (nonexistent) +++ visibility20.C (revision 816) @@ -0,0 +1,36 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: doug@foxtrot.ccmrc.ucsb.edu (Douglas Scott) +// Date: Tue, 10 Aug 93 10:06:33 PDT +// Subject: G++ 2.4.5 allows access to protected base members +// Message-ID: <9308101706.AA04485@foxtrot.ccmrc.ucsb.edu> + +class Base { +protected: + void protectedBaseFunction() {} // { dg-error "" } protected +public: + Base() {} +}; + + +class Derived : public Base { +public: + Derived() {} + void noticeThisFunction(Base *); +}; + + +void +Derived::noticeThisFunction(Base *b) { + b->protectedBaseFunction(); // ARM says this is not allowed// { dg-error "" } .* + // since it is not called on 'this' +} + +int main() { + Base b; + Derived d; + d.noticeThisFunction(&b); + printf("gpptest run\n");// { dg-error "" } .* +} +
visibility20.C Property changes : Added: svn:eol-style ## -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,14 @@ +// { dg-do assemble } +// GROUPS passed enums +// friends file +// From: offline!marc@ai.mit.edu (Marc Duponcheel) (Marc Duponcheel) +// Date: Sat, 6 Feb 93 23:31:22 PST +// Subject: some 2.2.2 bugs +// Message-ID: <9302070731.AA002jw@offline.UUCP> + +class X +{ + enum E { A, B }; +static enum E e; +}; +enum X::E X::e = A;
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,20 @@ +// { dg-do assemble } +// GROUPS passed nest +// nest file +// From: Neal Young +// Date: Mon, 11 Oct 93 17:03:59 EDT +// Subject: g++ 2.4.5 bug report: local class decl can't access local static var +// Message-ID: <9310112103.AA06326@cs> + +void f() +{ + static int s; + + struct local { + int j() { return s; } // should be okay, see 1991 ref. man. r.9.8 + }; +} + +int main() +{ +}
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: bad-error4.C =================================================================== --- bad-error4.C (nonexistent) +++ bad-error4.C (revision 816) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed bad-errors +#include + +void * operator new(size_t, int *); +void * operator new(size_t, void *); + +int *x = 0; +int foo(){ +new (x) int *; +new (&x) int *; +new (x) int *; // This is identical to line 8 !!! +return 1; +}
bad-error4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility28.C =================================================================== --- visibility28.C (nonexistent) +++ visibility28.C (revision 816) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// GROUPS passed visibility +extern "C" int printf( const char *, ...); + +class B { +public: + B() { } + virtual ~B() { printf( "B::~B\n"); } +}; + +class D : public B { +public: + virtual ~D() { printf( "D::~D\n"); } + void operator = ( int i) { this->~B(); } +}; + +int +main() +{ + D * pd = new D; + B * pb = pd; + delete pb; + return 0; +}
visibility28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt16.C =================================================================== --- cvt16.C (nonexistent) +++ cvt16.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// GROUPS passed conversions +// cvt file +// Message-Id: <9304121647.AA25819@tnt> +// From: mclaugh@tnt.acsys.com (Mark A. McLaughlin) +// Subject: g++ bug +// Date: Mon, 12 Apr 93 10:47:01 MDT + +#include + +class B { +}; + +class A : public B { + short s; +public: + A(short _s = 0) { s = _s; } + operator const short &() const { return s; } +}; + + int +main() { + A a(37); + //cout << a << endl; + std::cout << (short)a << std::endl; + + return 0; +} // main + +
cvt16.C Property changes : Added: svn:eol-style ## -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,9 @@ +// { dg-do assemble } +// GROUPS passed bit-fields +typedef int A; + +struct B +{ + int A : 2; +} ; +
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: temps3.C =================================================================== --- temps3.C (nonexistent) +++ temps3.C (revision 816) @@ -0,0 +1,29 @@ +// { dg-do run } +// GROUPS passed temps +// temps file +// Message-Id: <9308231535.AA19432@geant.cenatls.cena.dgac.fr> +// From: chatty@geant.cenatls.cena.dgac.fr (Stephane CHATTY) +// Subject: g++ 2.4.5 does not destroy temporaries +// Date: Mon, 23 Aug 93 17:35:34 +0200 + +#include + +class A { +public: + int a; + A (int i) : a (i) { ;} + A (const A& aa) : a (aa.a) { ;} + ~A () { printf ("PASS\n");; } +}; + +A +foo () +{ + return A (10); +} + +int main () +{ + int x = foo ().a; +} +
temps3.C Property changes : Added: svn:eol-style ## -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,26 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: roland@jts.com (Roland Knight ) +// Date: Thu, 29 Apr 1993 16:17:00 -0400 +// Subject: gcc 2.3.3 bug +// Message-ID:
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: dtors5.C =================================================================== --- dtors5.C (nonexistent) +++ dtors5.C (revision 816) @@ -0,0 +1,34 @@ +// { dg-do run } +// GROUPS passed destructors +// dtor file: +// Message-Id: <1992Jun25.181845.18886@leland.Stanford.EDU> +// From: niz@leland.stanford.edu (Jim Nisbet) +// Subject: gcc 2.2.2 -- c++ bug: destructor called twice (example) +// Date: 25 Jun 92 18:18:45 GMT + +#include + +int things = 0; + +class foo { +public: + foo() { things++; } + foo(const foo&) { things++; } + ~foo() { things--; } + + int i; +}; + +void +sub(foo f) { + ; +} + + +int main() { + sub(foo()); + if (things == 0) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
dtors5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeck1.C =================================================================== --- typeck1.C (nonexistent) +++ typeck1.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed typeck +// typeck file +// From: vern@daffy.ee.lbl.gov (Vern Paxson) +// Date: 24 Sep 1992 23:11:22 GMT +// Subject: 2.2.2 type-checking error (?) when comparing pointers +// Message-ID: <26475@dog.ee.lbl.gov> + + + class a { }; + class foo : a { }; + class bar : a { }; + + int test( const foo* f, const bar* b ) + { + return f == b;// { dg-error "" } + } +
typeck1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cvt7.C =================================================================== --- cvt7.C (nonexistent) +++ cvt7.C (revision 816) @@ -0,0 +1,81 @@ +// { dg-do run } +// GROUPS passed conversions +// cvt file +// From: krste@icsi.berkeley.edu (Krste Asanovic) +// Date: Mon, 24 Aug 92 19:05:10 PDT +// Message-Id: <9208250205.AA26351@icsib43.ICSI.Berkeley.EDU> +// Subject: implicit int. convs. from member refs. in switch expressions + +#include + +class A +{ +public: + A(int j) { i = j; } + A(A& a) { i = a.i; } + operator int() { return i; } + + void assign(int v) { i = v; } + int i; +}; + +class B +{ +public: + B(A& inArg) : in(inArg), out(0) {} + + A& in; + A out; + + void run(); +}; + +void +B::run() +{ + // I get a "switch quantity not an integer" error for this statement. + switch (in) + // Replacing above with "switch (int(in))" removes the error. + { + case 0: + out = 1; + break; + default: + out = 0; + break; + } +} + +int main() +{ + A a(1); + + A& ar = a; + + A& ar2 = ar; + + // ....but no errors for this switch statement. + switch (ar2) + { + case 1: + std::printf ("PASS\n"); + break; + default: + { std::printf ("FAIL\n"); return 1; } + } + + B b(a); + a.assign(3); + b.run(); + a.assign(0); + b.run(); + + return 0; +} + + + + + + +
cvt7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: refs4.C =================================================================== --- refs4.C (nonexistent) +++ refs4.C (revision 816) @@ -0,0 +1,25 @@ +// { dg-do run } +// GROUPS passed references + +// execution test + +int r; + +const int& min(const int& tX, const int& tY) +{ + return tX < tY ? tX : tY; +} + +void foo(const int m, const int n) +{ + if (m == 1 && n == 100) + /* OK */; + else + r = 1; +} + +int main() +{ + foo(min(2, 1), min(100, 200)); + return r; +}
refs4.C Property changes : Added: svn:eol-style ## -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,25 @@ +// { dg-do assemble } +// GROUPS passed initialization +class foo { +public: + int data; + foo(int dat) { data = dat; } +}; + +class bar { +public: + foo f[3] = { 1, 2, 3 }; // works: f[0] = 1, f[1] = 2, f[2] = 3 // { dg-error "" } ANSI C++ forbids initialization of member f; +}; + +class bar2 { +public: + foo f[3] = { foo(1), foo(2), foo(3) }; // { dg-error "" } ANSI C++ forbids initialization of member f; + // does not compile -- error: field initializer is not constant +}; + +int main(void) +{ + foo f[3] = { foo(1), foo(2), foo(3) }; + // standard C++ ... and it works too! :) + return 0; +}
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: operators33.C =================================================================== --- operators33.C (nonexistent) +++ operators33.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-new file +// From: flisakow@cae.wisc.edu +// Date: Thu, 1 Sep 94 18:21:09 CDT +// Subject: g++ bug? +// Message-ID: <9409012321.AA05346@hprisc-19.cae.wisc.edu> + +#include + + +struct fcell { + FILE *fd; + struct fcell *next; +}; + + +class FStack { +public: + struct fcell *top; + FStack() { top = NULL ; } ; + inline void push(FILE * fd1, int line_num, char *fname = NULL) { + struct fcell *tmp = new struct fcell; + tmp->fd = fd1; + tmp->next = top; + top = tmp ; + } +};
operators33.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parsing1.C =================================================================== --- parsing1.C (nonexistent) +++ parsing1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed parsing +// parsing folder +// From: hendrik%vedge.UUCP@iro.umontreal.ca +// Date: Wed, 23 Sep 92 17:10:28 -0400 +// Subject: parenthesized method +// Message-ID: <9209232110.AA02533@.> + + +class goo{ +public: + void noo_bloo(); +}; + +void choo(goo* too) +{ (too->noo_bloo)(); +} + +void choo_too(goo* too) +{ too->noo_bloo(); +}
parsing1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mentor1.C =================================================================== --- mentor1.C (nonexistent) +++ mentor1.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// { dg-options "-O" } +// GROUPS passed mentor +struct Word { + struct S1 *p1; +}; +struct S1 { + Word o; + void shift_left(int delta, int ct); +}; +inline void S1::shift_left(int delta, int ct) +{ + int cnt = ct; + for (S1 *to_p = this, *from_p = to_p + delta; cnt--;) *to_p++ = *from_p++; +} + +void dispose_t(S1 *tp, int from_index, int ct, const int d_last_t) +{ + int new_ct = d_last_t + 1 - ct; + tp[0].o.p1[from_index].shift_left(ct, new_ct - from_index); +}
mentor1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators16.C =================================================================== --- operators16.C (nonexistent) +++ operators16.C (revision 816) @@ -0,0 +1,30 @@ +// { dg-do run } +// GROUPS passed operators +// copy file +// From: gfm@mencon.mencon.oz.au (Graham Menhennitt) +// Date: Thu, 29 Apr 93 20:53:07 EST +// Subject: 4 bugs in g++ 2.3.3 +// Message-ID: <9304291053.AA00090@mencon> + +#include + +int pass = 0; +struct A { + A(void) {} + A(const A& a) { ; } + A& operator = (const A& a) { pass = 1; return *this; } +}; + +struct B { + B(const A& aa) { B::a = aa; } + A a; +}; + +int main(void) +{ + B b = A(); + if (pass) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } +}
operators16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: weak.C =================================================================== --- weak.C (nonexistent) +++ weak.C (revision 816) @@ -0,0 +1,19 @@ +// { dg-do link { target i?86-*-linux* x86_64-*-linux* } } +// { dg-options "-static" } +// Bug: g++ fails to instantiate operator<<. + +// libc-5.4.xx has __IO_putc in its static C library, which can conflict +// with the copy of __IO_putc in the libstdc++ library built by egcs. +#include +#include +#include + +std::istream x (0); + +main () { + x.get(); + std::putc(0, 0); + std::fgets(0, 0, 0); + x.get((char*) 0, 0); +} +
weak.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility12.C =================================================================== --- visibility12.C (nonexistent) +++ visibility12.C (revision 816) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: Mark Rawling +// Date: Wed, 30 Jun 93 15:28:34 +1000 +// Subject: member access rule bug +// Message-ID: <9306300528.AA17185@coda.mel.dit.CSIRO.AU> +struct a { + int aa; // { dg-error "" } private + }; + +class b : private a { + }; + +class c : public b { + int xx(void) { return (aa); } // aa should be invisible// { dg-error "" } .* + }; +
visibility12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors11.C =================================================================== --- ctors11.C (nonexistent) +++ ctors11.C (revision 816) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: <9302081631.AA14744@tera.com> +// From: rrh@tera.com (Robert R. Henry) +// Date: Mon, 8 Feb 93 08:31:39 PST +extern "C" int printf (const char *, ...); +class A{ +public: + inline A(int x){printf("constructing A with %d\n", x);} +}; + +class B:public A{ // { dg-error "" } non-default constructor +private: +public: +}; + +int main() +{ + B(10);// { dg-error "" } B doesn't have a constructor taking int +}
ctors11.C Property changes : Added: svn:eol-style ## -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,36 @@ +// { dg-do run } +// GROUPS passed initialization +// init file +// From: Richard Speed +// Date: Sun, 6 Jun 1993 15:19:41 -0600 (MDT) +// Subject: excess elements in aggr initzer +// Message-ID: + +extern "C" int printf (const char *, ...); + +class samp { + int a; +public: + samp(int n) { a = n; } + int get_a() { return a; } +}; + +int main() { + samp ob[4] [2] = { // Generated Error + 1, 2, + 3, 4, + 5, 6, + 7, 8, + }; + int i; + + if (ob[0][0].get_a() == 1 && ob[0][1].get_a() == 2 + && ob[1][0].get_a() == 3 && ob[1][1].get_a() == 4 + && ob[2][0].get_a() == 5 && ob[2][1].get_a() == 6 + && ob[3][0].get_a() == 7 && ob[3][1].get_a() == 8) + printf ("PASS\n"); + else + { printf ("FAIL\n"); return 1; } + + return 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: parsing9.C =================================================================== --- parsing9.C (nonexistent) +++ parsing9.C (revision 816) @@ -0,0 +1,32 @@ +// { dg-do assemble } +// GROUPS passed parsing +// From: Jason Merrill +// Date: Fri, 13 Aug 93 12:49:11 PDT +// Subject: 2.4.5 won't compile array of pointers to functions returning T +// Message-ID: <9308131949.AA26348@cygnus.com> +// From: "Robert M. Keller" +// Subject: g++ bug +// Date: Fri, 13 Aug 93 10:09:27 PDT + +/* Testing declaration of "array of pointers to functions returning T" */ + +typedef int T; + +T foo() +{ return 10; } + +T bar() +{ return 20; } + +T baz() +{ return 30; } + +int main() +{ +T (*apfrt[10])(); + +apfrt[0] = foo; +apfrt[1] = bar; +apfrt[2] = baz; + +}
parsing9.C Property changes : Added: svn:eol-style ## -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,25 @@ +// { dg-do assemble } +// GROUPS passed scoping +// local-class file +// From: schlaege@methusalix.ert.rwth-aachen.de (Chris Schlaeger H Zivojnovic) +// Date: Tue, 10 Aug 93 16:50:33 +0200 +// Subject: Bug report +// Message-ID: <9308101450.AA28016@methusalix.ert.rwth-aachen.de> + +int main() +{ + class foo + { + int i; + } ; + class bar + { + public: + bar() { y = 0; } + void f() { foo x; } + private: + int y; + } ; + + bar c; +}
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: arg8.C =================================================================== --- arg8.C (nonexistent) +++ arg8.C (revision 816) @@ -0,0 +1,28 @@ +// { dg-do run } +// GROUPS passed arg-matching +// arg-matching file +// Message-Id: <9307081747.AA14030@tnt> +// From: mclaugh@tnt.acsys.com (Mark A. McLaughlin) +// Subject: g++ bug +// Date: Thu, 8 Jul 93 11:47:28 MDT + + +#include +#include + +// With this declaration the program will not link. +template std::ostream & save(std::ostream & os, Type T); + + template std::ostream & +save(std::ostream & os, Type T) { + return os << T; +} // save + + int +main() { + int i = 10; + save((std::ostream &)std::cout, i) << std::endl; + short int s = 5; + save((std::ostream &)std::cout, s) << std::endl; + std::printf ("PASS\n"); +} // main
arg8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctors19.C =================================================================== --- ctors19.C (nonexistent) +++ ctors19.C (revision 816) @@ -0,0 +1,33 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// From: mkohtala@vinkku.hut.fi +// Date: Tue, 5 Oct 1993 19:31:16 +0200 +// Message-Id: <199310051731.AA12260@lk-hp-11.hut.fi> +// Subject: Nested class constructor calling bug + +class X +{ + public: + class Y + { + public: + Y(int i) : a(i) {} + int a; + }; + static void f(Y y); +}; + +void X::f(X::Y y) +{ +} + +int +main() +{ + X::Y y = X::Y(1); // Tries to call ctor Y instead of X::Y + X::f(X::Y(2)); // Tries to call Y instead of X::Y + + return 0; +} +
ctors19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm7.C =================================================================== --- arm7.C (nonexistent) +++ arm7.C (revision 816) @@ -0,0 +1,41 @@ +// { dg-do run } +// { dg-options "-w" } +// GROUPS passed ARM-compliance +// arm file (also in cvt file) +// Message-Id: <9303061246.AA09402@gjetost.cs.wisc.edu> +// From: solomon@cs.wisc.edu (Marvin Solomon) +// Subject: Incorrect resolution of conversion path +// Date: Sat, 6 Mar 93 06:46:27 -0600 + + +extern "C" int printf (const char *, ...); + +class Base { +public: + int i; + Base(int ii) : i(ii) {} +}; + +class Derived : public Base { +public: + Derived(int ii) : Base(ii) {} + operator Base&(); +}; + +Derived::operator Base&() { + Base *b = new Base(100*i); + return *b; +} + +int f(Base &b) { + if (b.i == 99) + { printf ("PASS\n"); return 0; } + else + { printf ("FAIL\n"); return 1; } +} + +int main() { + Derived d(99); + return f(d); +} +
arm7.C Property changes : Added: svn:eol-style ## -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,52 @@ +// { dg-do run } +// GROUPS passed operators +#include + +class shape { + public: + virtual int vDisplay(void) const = 0; + protected: + int X; + int Y; +}; + +class square :public shape { + public: + square(int x, int y, int width_) { + X = x; + Y = y; + width = width_; + } + int vDisplay(void) const { + printf ("PASS\n"); + return 0; + } + protected: + int width; +}; + + +class triangle :public shape { + public: + triangle(int x, int y, int width_, int height_) { + X = x; + Y = y; + width = width_; + height = height_; + } + int vDisplay(void) const { + printf ("FAIL\n"); + return 1; + } + protected: + int width; + int height; +}; + +int main() { + shape* s1 = new square(4,4,5); + shape* s2 = new triangle(6,6,2,3); + *s1 = *s2; + return s1->vDisplay(); +} +
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: arg11.C =================================================================== --- arg11.C (nonexistent) +++ arg11.C (revision 816) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// GROUPS passed arg-matching +// From: gustavo@cpqd.br (Gustavo Chaves) +// Date: Wed, 25 May 94 09:38:00 EST +// Subject: problem with user defined conversions in initialization +// Message-ID: <9405251238.AA19815@moon.cpqd.br> + +struct String { String(const char*); }; + +struct Ack { Ack(String); }; + +struct S { void method(Ack); }; // { dg-error "" } referenced below + +void function(Ack); + +int +foo(S *o) +{ // Neither call has a usable constructor for conversions of char[5] to Ack. + function("adsf");// { dg-error "" } + o->method("adsf");// { dg-error "" } + return 0; +}
arg11.C Property changes : Added: svn:eol-style ## -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,20 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// From: rac@qedinc.com (Robert Clark) +// Date: Tue, 14 Dec 93 10:45:50 PST +// Subject: bug in g++ 2.5.7 Array of objects +// Message-ID: <9312141845.AA09188@annapurna.qedinc.com> + + +class POOL { +public: + POOL(); +}; + +struct VAL_LIST { + POOL pool[2]; +}; + +VAL_LIST baz; +
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: ctors9.C =================================================================== --- ctors9.C (nonexistent) +++ ctors9.C (revision 816) @@ -0,0 +1,39 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// GROUPS passed constructors +// ctors file +// Message-Id: <9301132030.AA05210@cs.rice.edu> +// From: dougm@cs.rice.edu (Doug Moore) +// Subject: 2.3.3: accepts ctor-less derived class of ctor-ful base class +// Date: Wed, 13 Jan 93 14:30:21 CST +// Note: It gives an error now. But not a very good one. + +struct Foo +{ + Foo(int aa); + int a; + const Foo* operator-> () const {return this;} +}; + +Foo::Foo(int aa) +:a(aa) +{ } + + +struct var_Foo: public Foo +{ // { dg-error "" } base.*// ERROR - in class.* + var_Foo* operator-> () {return this;} +}; + +int blort(Foo& f) +{ + return f->a; +} + +int main() +{ + var_Foo b(2);// { dg-error "" } + b->a = 0; + int x = blort(b); + return x; +}
ctors9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: arm15.C =================================================================== --- arm15.C (nonexistent) +++ arm15.C (revision 816) @@ -0,0 +1,55 @@ +// { dg-do run } +// GROUPS passed ARM-compliance +// arm file +// From: Johan Bengtsson +// Date: Thu, 21 Oct 93 16:10:25 +0100 +// Subject: gcc 2.4.5 initializes base classes in mem-initializer order +// Message-ID: <9310211510.AA14943@holden.lulea.trab.se> + +#include +#include + +int state = 0; + +class A { public: + A() { + if (state == 0) + state = 1; + else { + printf ("FAIL\n"); + exit (1); + } + } +}; + +class B { public: + B() { + if (state == 1) + state = 2; + else { + printf ("FAIL\n"); + exit (1); + } + } +}; + +class AB : public A, public B { public: + AB() : B(), A() { + if (state == 2) + state = 3; + else { + printf ("FAIL\n"); + exit (1); + } + } +}; + +int main() +{ + AB ab; + if (state == 3) + printf("PASS\n"); + else + printf("FAIL\n"); + exit (state != 3); +}
arm15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operators25.C =================================================================== --- operators25.C (nonexistent) +++ operators25.C (revision 816) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// GROUPS passed operators +// opr-new file +// From: gparker@world.std.com (Glenn P Parker) +// Date: Mon, 25 Jan 1993 20:43:43 -0500 +// Subject: gcc bug +// Message-ID: <199301260143.AA14133@world.std.com> + +typedef int (**PPF)(int); + +int main(void) +{ + PPF pf2 = new (int (*) (int)); // internal compiler error on this line. + + return 0; +}
operators25.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: builtin1.C =================================================================== --- builtin1.C (nonexistent) +++ builtin1.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do run } +// { dg-options "" } +// GROUPS passed builtins +// Apparently not in g++ bug snapshot (was originally sent to bug-gcc) +// Message-Id: +// Date: Tue, 7 Dec 93 10:23 EST +// From: neal@ctd.comsat.com (Neal Becker) +// Subject: builtin_alloca on hpux (gcc-2.5.6) +// We have to avoid using -ansi, which results in a call to alloca instead of +// the use of __builtin_alloca, and thus ends up being unresolved. + +extern "C" int printf (const char *, ...); + +void* junk() { + return __builtin_alloca(10); +} +main() { printf ("PASS\n");}
builtin1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static-mem4.C =================================================================== --- static-mem4.C (nonexistent) +++ static-mem4.C (revision 816) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// GROUPS passed static-mem +struct test { + void test_member() { + static test& ds = *this; // FIX: static test* ds = this; + } +}; + + +int main() +{ + test t; +}
static-mem4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: visibility21.C =================================================================== --- visibility21.C (nonexistent) +++ visibility21.C (revision 816) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// GROUPS passed visibility +// visibility file +// From: klamer@mi.el.utwente.nl (Klamer Schutte) +// Date: Thu, 12 Aug 93 12:03:09 +0200 +// Subject: g++ 2.4.5 failed to report a bug +// Message-ID: <9308121003.AA02294@mi.el.utwente.nl> +class A { +protected: + void foo(); // { dg-error "" } protected +}; + +class B : public A +{ + void bar(A &a) + { a.foo(); }// { dg-error "" } .* +};
visibility21.C Property changes : Added: svn:eol-style ## -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,19 @@ +// { dg-do assemble } +// GROUPS passed friends +// friends file +// From: osinski@cs.nyu.edu (Ed Osinski) +// Date: Fri, 05 Jun 92 20:47:37 -0400 +// Subject: parameter name forgotten in certain friends +// Message-ID: <9206060047.AA05594@MURRAY.CS.NYU.EDU> + +class T2; + +class T { + friend void f (int&); +}; + +class T2 { + friend void f (int& i) { // BOGUS - + i = 1; + }; +};
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: ctors20.C =================================================================== --- ctors20.C (nonexistent) +++ ctors20.C (revision 816) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed constructors +// ctor file +// Message-Id: <9311011758.AA25157@thneed.cs.duke.edu> +// From: Vivek Khera +// Subject: g++ 2.5.0 fails to automatically generate default initializer +// Date: Mon, 01 Nov 1993 12:58:34 -0500 + +class String +{ + private: + char a[100]; + int len; + public: + String(); +}; + +String::String() +{ + len = 0; +} + + +struct List +{ + String item[100]; + int num_items; +// List(); // uncomment this line to let compile work +}; + +int +main(int argc, char **argv) +{ + List a; +}
ctors20.C Property changes : Added: svn:eol-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.