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

Subversion Repositories openrisc

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /openrisc/tags/gnu-src/gcc-4.5.1/gcc-4.5.1-or32-1.0rc1/gcc/testsuite/g++.old-deja/g++.jason
    from Rev 305 to Rev 338
    Reverse comparison

Rev 305 → Rev 338

/warning9.C
0,0 → 1,15
// { dg-do assemble }
// { dg-options "-Wsynth" }
 
struct A {
operator int ();
A& operator= (int);
};
 
int
main()
{
A a, b;
 
a = b;
}
warning9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth9.C =================================================================== --- synth9.C (nonexistent) +++ synth9.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 6837 +// Bug: anonymous union confuses g++. + +struct my_key { + my_key(const my_key&); + my_key(const char* n); +}; + +struct my_node { + my_node(my_key&); + union { + long cnt; + my_node* next; + }; + my_key a; +}; + +extern my_node n; +my_node a(n);
synth9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg6.C =================================================================== --- rfg6.C (nonexistent) +++ rfg6.C (revision 338) @@ -0,0 +1,4 @@ +// { dg-do assemble } + +const wchar_t *single = L"xyz" ; +const wchar_t *(array[]) = { L"xyz" };
rfg6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access13.C =================================================================== --- access13.C (nonexistent) +++ access13.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// PRMS Id: 4955 + +struct A { + protected: + int i; + void f (); +}; + +struct B: public A { + void g () { + this->A::i = 1; // { dg-bogus "" } access control failure + this->A::f(); // { dg-bogus "" } access control failure + } +};
access13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping14.C =================================================================== --- scoping14.C (nonexistent) +++ scoping14.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// [class.scope0]: The scope of a name declared in a class consists +// ... also of all ... default arguments ... in that class .... + +struct A { + void f (int A::* = &A::i); + int i; +};
scoping14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lineno4.C =================================================================== --- lineno4.C (nonexistent) +++ lineno4.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "" } +// GROUPS passed error-reporting +// Bug: # line directive in template definition interferes with growing obstack +template class A +{ +public: + +# 200 "lineno4.C" + int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + // { dg-message "note" "note" { target *-*-* } 200 } +}; + +template class A;
lineno4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offset2.C =================================================================== --- offset2.C (nonexistent) +++ offset2.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do run } +// PRMS Id: 5070 (testcase 2) + +int status = 1; + +struct foo { + foo& operator= (const foo&) { status = 0; return *this; } +}; + +struct xx { + foo a; +}; + +struct yy : public xx { + yy(foo& a) { xx::a = a; } +}; + +int main() +{ + foo f; + yy y (f); + + return status; +}
offset2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary7.C =================================================================== --- temporary7.C (nonexistent) +++ temporary7.C (revision 338) @@ -0,0 +1,36 @@ +// { dg-do run } +// PRMS ID: 7304 + +struct V { + int n; + V() : n(0) { } + V(int x) : n(x) { } +}; + +V baz(const V &x) +{ + return x; +} + +int bar(V v1, V v2, V v3) +{ + return v1.n; +} + +struct A { + A(): n(7) { } + int foo(); + V n; +}; + +int A::foo() +{ + V v1, v2; + return bar(n, baz(v1), v2); +} + +int main() +{ + A a; + return (a.foo() != 7); +}
temporary7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: loverload3.C =================================================================== --- loverload3.C (nonexistent) +++ loverload3.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 2010 +// Bug: g++ doesn't deal with overloads involving C-language fns properly. + +extern "C" double pow (double, double); +inline double pow (double d, int e) { return pow (d, (double) e); } + +void foo () +{ + pow (1.0, 1); + pow (1.0, 1.0); +}
loverload3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested8.C =================================================================== --- nested8.C (nonexistent) +++ nested8.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } + +struct A { }; +struct B: public A { + struct C { +friend struct B; // { dg-bogus "" } base clause w/o members + }; +};
nested8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new2.C =================================================================== --- new2.C (nonexistent) +++ new2.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do run } +// { dg-options "-Wno-deprecated -fno-exceptions" } +// PRMS Id: 6267 + +struct A { + int i; + A() { i = 2; } +}; + +main() +{ + A *p = new A (); +}
new2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse11.C =================================================================== --- parse11.C (nonexistent) +++ parse11.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// PRMS Id: 6825 + +class aClass +{ + ; // { dg-error "" } missing declaration +private: + ; // { dg-error "" } missing declaration +};
parse11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref11.C =================================================================== --- ref11.C (nonexistent) +++ ref11.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do run } +int main(int argc, char ** argv) { + + int (&var_field_ref)[] = * (int (*)[]) new int [42]; + int (&fix_field_ref)[1] = * (int (*)[1]) new int [42]; + + int static_field[42]; + + int *const &var_field_ptr_ref = var_field_ref; // { dg-bogus "" } + int *const &fix_field_ptr_ref = fix_field_ref; + int *const &static_field_ptr_ref = static_field; + + int * var_field_ptr = var_field_ref; // { dg-bogus "" } + int * fix_field_ptr = fix_field_ref; + int * static_field_ptr = static_field; + + return 0; +}
ref11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template40.C =================================================================== --- template40.C (nonexistent) +++ template40.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// PRMS id: 11315 +// Bug: g++ doesn't recognize the copy ctor for Array. + +template +class Array { +public: + Array(int sz=12) + : ia (new Type[sz]), size(sz) {} + ~Array() { delete[] ia;} + Array(const Array& r) : size(0) {} // just for testing +private: + Type *ia; + int size; +}; + +int main(int argc, char *argv[]) +{ + Array ia; // looping occurs on this line +}
template40.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dcast1.C =================================================================== --- dcast1.C (nonexistent) +++ dcast1.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 7162 + +struct B { + int i; + B() : i(1) {} +}; + +struct D : B { + int i; + D() : i(2) {} +}; + +void ch() +{ + D od2; + D &rd2 = od2; + + B &rd1 = dynamic_cast(rd2); +}
dcast1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmem2.C =================================================================== --- pmem2.C (nonexistent) +++ pmem2.C (revision 338) @@ -0,0 +1,44 @@ +// { dg-do run } +template +class aCallback +{ +public: + aCallback(Called& obj, int (Called::*met)()); + + int callback(); + +protected: + +private: + Called& object; + + int (Called::*method)(); + +}; + +template +aCallback::aCallback(Called& obj, + int (Called::*met)()) : +object(obj), +method(met) +{} + +template +int aCallback::callback() +{ + return (object.*method)(); +} + +struct myStruct +{ + int action() {return 0;} +}; + +int main() +{ + myStruct toto; + + aCallback cb(toto, &myStruct::action); + + return cb.callback(); +}
pmem2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template23.C =================================================================== --- template23.C (nonexistent) +++ template23.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Testcase for instantiation with cv-qualified type + +template +struct A +{ + void foo(); +}; + +template void A::foo() { } + +template class A;
template23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg23.C =================================================================== --- rfg23.C (nonexistent) +++ rfg23.C (revision 338) @@ -0,0 +1,3 @@ +// { dg-do assemble } + signed char *ptr2 = "hello"; /* { dg-error "" } changing sign */ +unsigned char *ptr3 = "hello"; /* { dg-error "" } changing sign */
rfg23.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,10 @@ +// { dg-do run } +// PRMS Id: 5126 + +extern int i, j; +static const int foo [] = { i, j }; +int i = 5, j = 42; +int main() +{ + return foo[1] != 42; +}
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: dot.C =================================================================== --- dot.C (nonexistent) +++ dot.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 4143 +// Bug: Pointer is silently dereferenced in method call. + +extern "C" int printf (const char *, ...); + +class Test +{ + char ch; + public: + Test(char c) : ch(c) {} + void Print() { printf("%c", ch); } +}; + +int main() +{ + Test *p = new Test('x'); + + p.Print(); // { dg-error "" } +}
dot.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: loverload.C =================================================================== --- loverload.C (nonexistent) +++ loverload.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: g++ can't deal with multi-language overloading. + +extern void foo (int, int); +extern "C" void foo (int); + +void bar () +{ + foo (1); + foo (1, 2); +}
loverload.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new.C =================================================================== --- new.C (nonexistent) +++ new.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// Bug: new doesn't make sure that the count is an integral value. + +#include +extern "C" int printf (const char *, ...); +extern "C" void *malloc (size_t); +size_t s; + +void * operator new (size_t siz) throw (std::bad_alloc) { + if (s == 0) + s = siz; + else + s = (s != siz); + return malloc (siz); +} + +int main() +{ + s = 0; + + float f = 3; + int* b1 = new int[(int)f]; + int* b2 = new int[f]; // { dg-error "" } new requires integral size + + return s; +}
new.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping8.C =================================================================== --- scoping8.C (nonexistent) +++ scoping8.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ allows two different meanings of a name in the same scope. + +typedef int foo; // { dg-error "" } +struct A { + A (foo); + int foo (); // { dg-error "" } foo already used in scope +};
scoping8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse1.C =================================================================== --- parse1.C (nonexistent) +++ parse1.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ parses the declaration of r as a function declaration. + +void foo (int i) +{ + int &r (i); + r = 1; // { dg-bogus "" } +}
parse1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref2.C =================================================================== --- ref2.C (nonexistent) +++ ref2.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ can't deal with references to arrays. + +typedef float Matrix[4][4]; +Matrix m; +Matrix& f () { return m; }
ref2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: inline2.C =================================================================== --- inline2.C (nonexistent) +++ inline2.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// { dg-options "-O" } +// Bug: the lang-specific bits of the decl for g aren't being copied when +// inlining. + +inline void f () { + void g (); +} + +void h() { + f(); // causes compiler segfault - +}
inline2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template5.C =================================================================== --- template5.C (nonexistent) +++ template5.C (revision 338) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// Bug: g++ fails to compare integer constants properly. + +template +struct Matrix { + int base [X] [Y]; +}; + +template +Matrix& Mul(Matrix& Q,Matrix& A,Matrix& B) { + for(int i=0;i q; + Matrix<2, 4> a; + Matrix<4, 3> b; + q = Mul (q, a, b); +}
template5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload7.C =================================================================== --- overload7.C (nonexistent) +++ overload7.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ thinks there is a default conversion from A& to B*. +// There isn't. + +struct A { + operator A* (); +}; + +struct B: public A { }; + +void foo (B* bp); + +void bar (A& a) { + foo (a); // { dg-error "" } +}
overload7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ambig3.C =================================================================== --- ambig3.C (nonexistent) +++ ambig3.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Testcase for ambiguity between function and variable declaration (8.2). + +struct A { + A (int, int); + int k; +}; + +void f () +{ + int i[2], j; + A a (int (i[1]), j); // { dg-bogus "" } late parsing + A b (int (i[1]), int j); // function + a.k = 0; // { dg-bogus "" } late parsing + b (i, j); +}
ambig3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse9.C =================================================================== --- parse9.C (nonexistent) +++ parse9.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do run } +// PRMS Id: 5720 +// Bug: the extra set of parens confuses the expr/declarator disambiguation. + +class Fu +{ + int val; +public: + Fu(int i) : val(i) { } + void print() { } +}; + +int main(int argc, char * argv[]) +{ + int * i = &argc; + + Fu((*i)).print(); // { dg-bogus "" } + Fu((*j)); +}
parse9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mi.C =================================================================== --- mi.C (nonexistent) +++ mi.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do run } +int status; + +struct A { virtual void foo () { status = 1; } }; +struct B { }; +struct C : public A, public B { }; +struct D { virtual void baz () { } }; +struct E : public D, public C { void foo () { status = 0; } }; + +int main () +{ + E* ep = new E; + + ep->foo(); + + return status; +}
mi.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access22.C =================================================================== --- access22.C (nonexistent) +++ access22.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// PRMS Id: 8518 +// Bug: Call to foo is not checked for accessibility + +class A +{ + private: + static void foo() {} // { dg-error "" } + public: + void goo() {} +}; + +struct B : public A +{ + void func() { foo(); } // { dg-error "" } +}; + +int main() +{ + B b; + b.func(); +}
access22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default3.C =================================================================== --- default3.C (nonexistent) +++ default3.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: type_list_equal aborts when it sees lang-specific tree nodes. + +struct A { }; +void f (A a = A()); +void g (A a = A());
default3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion3.C =================================================================== --- conversion3.C (nonexistent) +++ conversion3.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +void qsort (void *, int, int, int (*)(const void *, const void *)); +int f (char *, char *); +void g () +{ + typedef int (*pf)(void *, void *); + qsort(0, 0, 0, pf(f)); // { dg-error "" } adding const to function parms +}
conversion3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf7.C =================================================================== --- pmf7.C (nonexistent) +++ pmf7.C (revision 338) @@ -0,0 +1,28 @@ +// { dg-do run } +// PRMS Id: 6486 +// Make sure that no confused handling of COND_EXPRs and SAVE_EXPRs messes +// with the number of calls to foo. + +int c; + +struct A { + void f () {} + virtual void g () {} +}; + +A& foo () +{ + static A a; + ++c; + return a; +} + +int main () +{ + void (A::*p)() = &A::f; + (foo ().*p)(); + p = &A::g; + (foo ().*p)(); + + return 2 - c; +}
pmf7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cast1.C =================================================================== --- cast1.C (nonexistent) +++ cast1.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ fails to grok functional casts in all situations. + +class A { +public: + typedef int B; + static B foo() { return B(1); } // { dg-bogus "" } +};
cast1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeid1.C =================================================================== --- typeid1.C (nonexistent) +++ typeid1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do compile } +#include +#include + +struct foo { double f(int); }; + +int main() { + double f (int); + const std::type_info &r = typeid (f); + std::cout << typeid(f).name() << std::endl; + std::cout << typeid(foo::f).name() << std::endl; /* { dg-error "" } */ +}
typeid1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template32.C =================================================================== --- template32.C (nonexistent) +++ template32.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: Instantiating A screws with class bindings for B + +template struct A { }; +struct B { + typedef int foo; + void f (); +}; + +void B::f () { A a; foo i; }
template32.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool5.C =================================================================== --- bool5.C (nonexistent) +++ bool5.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do run } +int main () +{ + bool b = false; + int i = b++; + if (i != false || b != true) + return 1; + i = b++; + if (i != true || b != true) + return 1; +}
bool5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template15.C =================================================================== --- template15.C (nonexistent) +++ template15.C (revision 338) @@ -0,0 +1,28 @@ +// { dg-do run } +// PRMS Id: 2139 +// Bug: g++ tries to instantiate the template with types on the function +// obstack and fails. + +template +class X { +public: + X(int) { } + + T x; +}; + +class A { }; + +int main() +{ + int i; + X xi(i); + X xd(i); + + X fp0(i); + X fp1(i); + X fp2(i); + + X mp0 (i); + X mp1 (i); +}
template15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload34.C =================================================================== --- overload34.C (nonexistent) +++ overload34.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// PRMS ID: 8010 + +class X { + int & flag; +public: + void f(){ flag++ ; } +};
overload34.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload17.C =================================================================== --- overload17.C (nonexistent) +++ overload17.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// Bug: g++ fails to prefer UDC's alone to UDC's plus standard conversions. + +struct B { }; +struct D: public B { }; +struct DP { + operator D * () const; + operator double () const; +}; + +void f (B *); +void f (D *); +void g (double); +void g (float); + +void h (DP p) +{ + f (p); + g (p); +}
overload17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempinst1.C =================================================================== --- tempinst1.C (nonexistent) +++ tempinst1.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do link } +// { dg-options "-g" } +// Bug: g++ fails to instantiate operator<<. + +struct ostream { + ostream& operator<< (const char *) { return *this; }; +}; + +template class foo; + +template ostream& operator<< (ostream& ios, foo&obj) {return ios;} + +template class foo { + friend ostream& operator<<<>(ostream&, foo&); +}; + +int main() +{ + ostream cout; + foo foo_obj; + cout << foo_obj; // causes linker error + return 0; +}
tempinst1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lineno.C =================================================================== --- lineno.C (nonexistent) +++ lineno.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug; g++ binds a function definition to the line number of a later decl. + +void foo () { } // { dg-error "" } redeclared +void foo (); // { dg-bogus "" } invalid binding +void foo () { } // { dg-error "" } redeclared
lineno.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mangle3.C =================================================================== --- mangle3.C (nonexistent) +++ mangle3.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// PRMS Id: 7563 +// Bug: declaration at function scope causes mismangling. + +int main() +{ + char ArrA[1][1][2][3], + ArrB[1][1][2][3]; + + void HitMe(char [1][1][2][3], char [1][1][2][3]); + + HitMe(ArrA, ArrB); + + return 0; +} + +void HitMe(char A[1][1][2][3], char B[1][1][2][3]) +{ + return; +}
mangle3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning2.C =================================================================== --- warning2.C (nonexistent) +++ warning2.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// g++ ought to warn about casting a base pointer to a derived reference. + +struct A { + virtual void f () = 0; +}; + +struct B: public A { void f () { } }; + +int main() +{ + B* bp; + A& ar = (A&)bp; // { dg-warning "" } +}
warning2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth2.C =================================================================== --- synth2.C (nonexistent) +++ synth2.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// PRMS Id: 4623 +// Bug: g++ tries and fails to synthesize a copy constructor for D. + +class A { }; +class B: public virtual A { }; +class C: public A { }; +class D: public B, public C { }; // { dg-bogus "" } bad synthesis
synth2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access7.C =================================================================== --- access7.C (nonexistent) +++ access7.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// Simple testcase for access control. + +class A { + protected: + static void f (); +}; + +class B: public A {}; +class C: public A {}; +class D: public C, public B { + void g () { A::f(); } // { dg-bogus "" } wrongly ambiguous static member call +};
access7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: builtin2.C =================================================================== --- builtin2.C (nonexistent) +++ builtin2.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } + +static inline void strlen (const char *) { } + +void f () +{ + strlen("Hi"); // { dg-bogus "" } wrongful overload +}
builtin2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: byval2.C =================================================================== --- byval2.C (nonexistent) +++ byval2.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// From: panisset@cae.ca (Jean-Francois Panisset) +// Subject: 2.6.0 pre-rel, internal error, regression, mips-sgi-irix4 +// Date: Thu, 14 Jul 94 23:34:21 EDT + +class Char +{ +protected: + char rep; +public: + Char (const char ) {} + operator char() const; + void operator -= (const Char ); +}; + +inline Char operator - (const Char a, const Char b) { return Char(0); } +inline char operator == (const Char a, const char b) { return 0; } + +char mystrcmp(Char s[31], Char t[31]) +{ + for (; *s == *t; ++s, ++t) if (*s == '\0') return 0; + return char(*s - *t); +}
byval2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return2.C =================================================================== --- return2.C (nonexistent) +++ return2.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do run } +// PRMS Id: 5368 +// Bug: the X temporary in foo() is not destroyed. + +int c = 0; + +struct X { + X (int) { c++; } + ~X() { c--; } +}; + +struct Y { + Y(const X &) { } +}; + +Y foo() { + return X(3); +} + +int main() +{ + foo(); + return c; +}
return2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested1.C =================================================================== --- nested1.C (nonexistent) +++ nested1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ can't deal with function-local classes that talk about themselves. + +void foo() { + class Wrapper { + public: + void F (void * Wrapperptr) + { + Wrapper * wrapptr = ( Wrapper *) Wrapperptr; // { dg-bogus "" } + } + }; +}
nested1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg7.C =================================================================== --- rfg7.C (nonexistent) +++ rfg7.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: fixincludes and/or cpp mangle the definition of wchar_t so that this +// doesn't work. + +#include +wchar_t array[] = L"xxx"; // { dg-bogus "" } wchar_t
rfg7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access14.C =================================================================== --- access14.C (nonexistent) +++ access14.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } + +template struct A { T t; }; + +template class B: private T { + public: + T::t; // { dg-bogus "" } doesn't recognize access decl +}; + +template class B >;
access14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping15.C =================================================================== --- scoping15.C (nonexistent) +++ scoping15.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// { dg-options "-ffriend-injection" } +// Bug: g++ ignores the :: qualification and dies trying to treat an integer +// variable as a list of functions. + +class DComplex { +public: + friend double imag(const DComplex& a); +}; + +class FComplex { +public: + friend float imag(const FComplex& a); +}; + +void +scnrm2(FComplex cx[]) +{ + int imag; + ::imag( cx[0] ); +}
scoping15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lineno5.C =================================================================== --- lineno5.C (nonexistent) +++ lineno5.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// GROUPS passed error-reporting +// Bug: incomplete instantiation messes with lineno +template class A; + +int main() +{ + A *p; + undef1();// { dg-error "" } +}
lineno5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offset3.C =================================================================== --- offset3.C (nonexistent) +++ offset3.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// PRMS Id: 5070 (bug 2) + +struct A { + void f (); +}; + +struct Ptr { + A* operator->(); +}; + +struct B { + Ptr p; +}; + +struct C: public B { + void g (); +}; + +void C::g() { + B::p->f(); // { dg-bogus "" } +}
offset3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary8.C =================================================================== --- temporary8.C (nonexistent) +++ temporary8.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do run } +// Test for proper handling of temporaries in ?: exprs. + +extern "C" int printf (const char *, ...); +int c = 0, d = 0; + +class A { +public: + A() { ++c; } + A(const A&) { ++c; } + ~A() { ++d; } +}; + +A f (const A& a) +{ + return (c ? A() : A()); +} + +int main() +{ + { + f (c ? A() : A()); + } + printf ("%d %d\n", c, d); + return c != d || c != 2; +}
temporary8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: loverload4.C =================================================================== --- loverload4.C (nonexistent) +++ loverload4.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ dies on this input. + +inline char abs (char x) { return 0; } + +extern "C" { + inline int abs (int x) { return 1; } +}
loverload4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new3.C =================================================================== --- new3.C (nonexistent) +++ new3.C (revision 338) @@ -0,0 +1,38 @@ +// { dg-do run } +// { dg-options "-fcheck-new -pedantic -Wno-long-long" } +// PRMS Id: 6037 + +extern "C" void * malloc (__SIZE_TYPE__); + +int ena = 0; + +struct A { + int i; + A () { i = 2; } + void * operator new (__SIZE_TYPE__ s) + { + if (ena) + return 0; + return malloc (s); + } +}; + +struct B { + int i; + B () { i = 2; } + void * operator new (__SIZE_TYPE__ s) throw() + { + if (ena) + return 0; + return malloc (s); + } +}; + +int main () +{ + ena = 1; + A *ap = new A; + B *bp = new B; + + return ap || bp ; +}
new3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse12.C =================================================================== --- parse12.C (nonexistent) +++ parse12.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do run } +// PRMS Id: 6821 + +struct A { + int operator()(int i) { return i; } +}; + +struct B { + A* p; + int f () { return (*p)(42); } // { dg-bogus "" } +}; + +int main () +{ + B b = { new A }; + + return b.f () != 42; +}
parse12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref12.C =================================================================== --- ref12.C (nonexistent) +++ ref12.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do run } +void f (const char *const &) { } +int main () +{ + f ("hi"); +}
ref12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template41.C =================================================================== --- template41.C (nonexistent) +++ template41.C (revision 338) @@ -0,0 +1,34 @@ +// { dg-do run } +// PRMS Id: 11420 +// Bug: Can't handle indirect virtual template base init. + +extern "C" int printf (const char *, ...); + +template +class Vbase { + public: + Vbase(T i) { printf ("%d\n", i); } +}; + +template +class D1 : virtual public Vbase { + public: + D1(T i) : Vbase(i) {} +}; + +template +class D2 : virtual public Vbase { + public: + D2(T i) : Vbase(i) {} +}; + +template +class Most : public D1, public D2 { + public: + Most(T i) : D1(i), D2(i), Vbase(i) {} +}; + +int main () { + Most x(2); + return 0; +}
template41.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dcast2.C =================================================================== --- dcast2.C (nonexistent) +++ dcast2.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do run } +struct A { virtual void f() { } }; +struct B { virtual void g() { } }; +struct C : public A, public B { }; + +int main () +{ + C* cp = 0; + B* bp = 0; + + if (dynamic_cast (cp) != 0) + return 1; + + if (dynamic_cast (bp) != 0) + return 1; + + if (dynamic_cast (bp) != 0) + return 1; +}
dcast2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmem3.C =================================================================== --- pmem3.C (nonexistent) +++ pmem3.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do run } +// Test that comparison of pointers to members does not complain about +// contravariance violation. + +struct A { int i; }; +struct B : public A { int j; int f (); }; +int main () +{ + int A::*apm = &A::i; + int B::*bpm = apm; + return apm != bpm; +}
pmem3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template24.C =================================================================== --- template24.C (nonexistent) +++ template24.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do run } +// Bug: g++ doesn't find the conversion from ostream_withassign to ostream. + +#include + +template +struct A { + T t; +}; + +template +std::ostream & operator<< (std::ostream & os, A & a) +{ + os << a.t; + return os; +} + +int main () +{ + A a = { 1 }; + std::cout << a << std::endl; +} +
template24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typedef2.C =================================================================== --- typedef2.C (nonexistent) +++ typedef2.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do run } +// PRMS Id: 5367 +// Bug: the nested name of C::func gets hosed. + +struct C { + typedef int func(int *, int *); +}; + +int +main() +{ + C::func *handler; +}
typedef2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload26.C =================================================================== --- overload26.C (nonexistent) +++ overload26.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// Bug: g++ tries to build up a mangled name for its ideal match, which +// fails for one call below. + +extern const char foo[]; +extern const char baz[10]; +extern const char *fred; + +struct A { + void f(const char *); +} *a; + +void bing(const char *); +int main () +{ + a->f(foo); // { dg-bogus "" } because foo's size unknown. + a->f(baz); + a->f(fred); + bing(fred); + bing(foo); + bing(baz); +}
overload26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg24.C =================================================================== --- rfg24.C (nonexistent) +++ rfg24.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +typedef int Int; + +Int Int_object_1; + +void test () +{ + ((Int) Int_object_1) = Int_object_1; /* { dg-error "" } not an lvalue*/ +}
rfg24.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,42 @@ +// { dg-do run } +// PRMS Id: 5652 +// Bug: strings does not get initialized. + +#include + +class My_string { + char *str; + int len; +public: + My_string(const char* string); + My_string(const My_string &); + ~My_string() { delete str; } + char* char_p() { return str; } +}; + +const My_string strings[4] = { + "first string", + "second string", + "third string", + "fourth string" +}; + +My_string::My_string(const char* string) +{ + len = strlen(string) + 1; + str = new char[len]; + memcpy(str, string, len); +} + +My_string::My_string(const My_string &string) +{ + len = string.len; + str = new char[len]; + memcpy(str, string.str, len); +} + +int main() +{ + My_string str1 = strings[0]; + return strcmp ("first string", str1.char_p ()) != 0; +}
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: dtor2.C =================================================================== --- dtor2.C (nonexistent) +++ dtor2.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do run } +// PRMS Id: 5163 +// Bug: g++ doesn't accept the explicit destructor call syntax for templates. + +template struct A { }; +A a; + +int main() +{ + a.~A(); // { dg-bogus "" } +}
dtor2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping9.C =================================================================== --- scoping9.C (nonexistent) +++ scoping9.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ silently mangles the second 'B' to 'A::B', so the definition is +// lost. + +struct A { + enum B { }; +}; + +struct C: public A { + enum B { }; + void foo (C::B); +};
scoping9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse2.C =================================================================== --- parse2.C (nonexistent) +++ parse2.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ doesn't understand constructor syntax for pointers. + +void f () { + char * p (0); +}
parse2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref3.C =================================================================== --- ref3.C (nonexistent) +++ ref3.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// PRMS Id: ???? + +void f (const int& i) +{ + &(int&)i; // { dg-bogus "" } references ARE lvalues +}
ref3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: optimize.C =================================================================== --- optimize.C (nonexistent) +++ optimize.C (revision 338) @@ -0,0 +1,42 @@ +// { dg-do assemble } +// { dg-options "-O -pedantic-errors" } +// Bug: g++ claims that control can fall off the end of these functions. +// PRMS Id: 4943 + +struct A { + A(); + A(const A&); + A& operator= (const A&); + ~A(); +}; + +int f () +{ + A a[2]; + return 1; +} // { dg-bogus "" } jump_optimize + +int g () +{ + A a; + return 1; +} // { dg-bogus "" } jump_optimize + +struct B { + B(); + B(const B&); + B& operator= (const B&); + ~B(); +}; + +inline B::~B() +{ + int i = 2; + while (i--) ; +} + +int h () +{ + B b; + return 1; +} // { dg-bogus "" } jump_optimize
optimize.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: inline3.C =================================================================== --- inline3.C (nonexistent) +++ inline3.C (revision 338) @@ -0,0 +1,43 @@ +// { dg-do run } +// { dg-options "-O2" } +// Testcase for order of destruction. + +extern "C" int printf (const char *, ...); +int c; +int r; + +struct B { + B(); + B( B const& ); + ~B(); +}; + +struct A { + A(); + A( A const& ); + ~A(); + operator B (); +}; + +inline A::operator B () { printf( "operator B ()\n"); return B(); } + +A f(); +void g( B const& ); + +int +main() +{ + g( f() ); + return r; +} + +B::B() { printf( "B::B()\n" ); if (++c != 2) r = 1; } +B::B( B const& ) { printf( "B::B( B const& )\n" ); r = 1; } +B::~B() { printf( "B::~B()\n" ); if (--c != 1) r = 1; } + +A::A() { printf( "A::A()\n" ); if (++c != 1) r = 1; } +A::A( A const& ) { printf( "A::A( A const& )\n" ); r = 1; } +A::~A() { printf( "A::~A()\n" ); if (--c != 0) r = 1; } + +A f() { printf( "f()\n"); return A(); } +void g( B const& ) { printf( "g()\n"); }
inline3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash10.C =================================================================== --- crash10.C (nonexistent) +++ crash10.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// PRMS Id: 5155 + +struct A { + enum foo { bar }; +}; + +typedef A::foo A::foo; // { dg-error "" } causes compiler segfault
crash10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template6.C =================================================================== --- template6.C (nonexistent) +++ template6.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do run } +// PRMS Id: 4656 +// Testcase for use of member pointers in template resolution + +template class A { + public: + A() : a(1) {} + T a; +}; + +template +int foo (T A::*p) +{ + return 0; +} +int main() +{ + int A::*pm = &A::a; // { dg-bogus "" } failed temp resolution + foo (pm); + return 0; +}
template6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: vecdel.C =================================================================== --- vecdel.C (nonexistent) +++ vecdel.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +__SIZE_TYPE__ newsize = 0; +__SIZE_TYPE__ delsize = 0; + +struct A { + int i; + void * operator new [] (__SIZE_TYPE__ i) + { newsize = i; return ::operator new [](i); } + void operator delete [] (void *p, __SIZE_TYPE__ i) + { delsize = i; ::operator delete [](p); } +}; + +int main() +{ + A* ap = new A [2]; + delete [] ap; + if (!newsize || newsize != delsize) + return 1; + return 0; +}
vecdel.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload8.C =================================================================== --- overload8.C (nonexistent) +++ overload8.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Bug: g++ fails to catch the ambiguity below. + +struct A { + operator int () { return 1; } + operator int &() { return 1; } // { dg-error "" } +};
overload8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access23.C =================================================================== --- access23.C (nonexistent) +++ access23.C (revision 338) @@ -0,0 +1,80 @@ +// { dg-do assemble } +// PRMS Id: 9127 +// Bug: members of anonymous unions are not access-controlled. + +#include + +struct Foo { +public: + union { + long A; + void *pX; + }; + union X { + long A; + void *pX; + } PUB ; + int PUB_A; +protected: + union { + long B; // { dg-error "" } protected + void *pY; // { dg-error "" } protected + } ; + union Y { + long B; + void *pY; + } PRT; // { dg-error "" } protected + int PRT_A; // { dg-error "" } protected +private: + union { + long C; // { dg-error "" } private + void *pZ; // { dg-error "" } private + }; + union Z { + long C; + void *pZ; + } PRV; // { dg-error "" } private + int PRV_A; // { dg-error "" } private +}; + +struct Bar : public Foo { +public: + void DoSomething() { + PUB_A = 0; + Foo::A = 0; + printf("%x\n",pX); + Foo::PUB.A = 0; + printf("%x\n",PUB.pX); + B = 0; + printf("%x\n",Foo::pY); + PRT_A = 0; + PRT.B = 0; + printf("%x\n",Foo::PRT.pY); + PRV_A = 0; // { dg-error "" } + Foo::C = 0; // { dg-error "" } + printf("%x\n",pZ); // { dg-error "" } + Foo::PRV.C = 0; // { dg-error "" } + printf("%x\n",PRV.pZ); // { dg-error "" } + } +}; + +int main() +{ + Foo a; + + a.PUB_A = 0; + a.A = 0; + printf("%x\n",a.pX); + a.PRT_A = 0; // { dg-error "" } + a.B = 0; // { dg-error "" } + printf("%x\n",a.pY); // { dg-error "" } + a.PRV_A = 0; // { dg-error "" } + a.C = 0; // { dg-error "" } + printf("%x\n",a.pZ); // { dg-error "" } + a.PUB.A = 0; + printf("%x\n",a.PUB.pX); + a.PRT.B = 0; // { dg-error "" } + printf("%x\n",a.PRT.pY); // { dg-error "" } + a.PRV.C = 0; // { dg-error "" } + printf("%x\n",a.PRV.pZ); // { dg-error "" } +}
access23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion4.C =================================================================== --- conversion4.C (nonexistent) +++ conversion4.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +struct A { + A (int); +}; +struct B { + operator int () { return 1; } +}; +void f (const A&); +void g() +{ + B b; + f ((A) b); + f (A (b)); // { dg-bogus "" } functional cast treated differently from C style +}
conversion4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf8.C =================================================================== --- pmf8.C (nonexistent) +++ pmf8.C (revision 338) @@ -0,0 +1,30 @@ +// { dg-do run } +// PRMS Id: 6905 + +class Parent { +public: + void DoSomething() { return; } + int i; +}; + +class Child : public Parent { +public: +}; + +class User { +public: + void DoAnyThing(void (Parent::*)(void)) { return; } + void DoAThing(void (Child::*)(void)) { return; } + void DoAThing(int Child::*) { return; } +}; + + +int main() +{ + User a; + + a.DoAnyThing(&Child::DoSomething); + a.DoAThing(&Child::DoSomething); + a.DoAThing(&Parent::DoSomething); + a.DoAThing(&Parent::i); +}
pmf8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cast2.C =================================================================== --- cast2.C (nonexistent) +++ cast2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// The compiler tried to build up a double with a NOP_EXPR from +// integer_zero_node, which fails. + +template +class vector { +public: + vector (int n, const T& value = T()) {} +}; + +void +foo (void) +{ + vector v (10); +}
cast2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeid2.C =================================================================== --- typeid2.C (nonexistent) +++ typeid2.C (revision 338) @@ -0,0 +1,31 @@ +// { dg-do run } +// PRMS Id: 11596 + +#include +extern "C" int printf (const char *, ...); + +class Chicken +{ +public: + int eggs_per_day; +}; + +template +class Flock +{ +public: + Bird * flock_head; + int head_count; + void print_self() { + printf ("A flock of %d %ss\n", head_count, typeid (Bird).name ()); + printf ("A flock of %d %ss\n", head_count, typeid (*flock_head).name ()); + } +}; + +int main() +{ + Flock x; + printf ("%s\n", typeid(x).name()); + x.head_count = 42; + x.print_self(); +}
typeid2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool6.C =================================================================== --- bool6.C (nonexistent) +++ bool6.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// Bug: The conversion from bool to int gets stripped. + +bool b; + +int main () +{ + return ((!b) != 0); +}
bool6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template33.C =================================================================== --- template33.C (nonexistent) +++ template33.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// Test nested enums in templates. + +template +class A +{ +public: + enum muni {X, Y}; + + muni e() { return X; } + muni f(); +}; + +template +typename A::muni A::f() { return X; } + +template class A;
template33.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template16.C =================================================================== --- template16.C (nonexistent) +++ template16.C (revision 338) @@ -0,0 +1,34 @@ +// { dg-do run } +// PRMS Id: 1502 +// Bug: g++ fails to resolve 'gnc' in the call to 'grid'. + +template class foo { +public: + foo() { } +}; + +template class bar : public foo { +public: + bar() : foo() {} +}; + +template class ben : public foo { +public: + ben() : foo() {} + void grid(T (*f)(bar&),bar& x,bar& y,bar& param); +}; + +template void ben::grid(T (*f)(bar&),bar& x,bar& y,bar& param) { } + +template T gnc(bar& a) +{ + return 0; +} + +int main() +{ + ben a; + bar x,y,p; + a.grid(gnc,x,y,p); + return 0; +}
template16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload35.C =================================================================== --- overload35.C (nonexistent) +++ overload35.C (revision 338) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// PRMS Id: 9647 + +class castBug +{ +public: + operator int *(); + operator const int *() const; +}; + +class castBug2 +{ +public: + operator const int *() const; +}; + +void voidfn(void *); + +void test() +{ + castBug b; + castBug2 b2; + voidfn(b); // { dg-bogus "" } + voidfn(b2); // { dg-error "" } discarding const +}
overload35.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash3.C =================================================================== --- crash3.C (nonexistent) +++ crash3.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// Bug: g++ tries to generate initialization semantics for a Node from an int, +// and fails. + +struct Node +{ // { dg-message "note" } + Node* child[2]; +}; + +void bug(int i) +{ + Node* q = new Node(i); // { dg-error "no matching" } +}
crash3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload18.C =================================================================== --- overload18.C (nonexistent) +++ overload18.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// pushdecl gets confused by this. + +void f (); +void f (int, int); +template T f (T) { }
overload18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion.C =================================================================== --- conversion.C (nonexistent) +++ conversion.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Bug: g++ doesn't find the conversion path from DPtr& to B*. + +class B {}; +class D : public B {}; +class DPtr +{ +public: + operator D*() const; +}; + +void foo (B* bp); +void bar (DPtr& dp) +{ + foo (dp); +}
conversion.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg16.C =================================================================== --- rfg16.C (nonexistent) +++ rfg16.C (revision 338) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// Bug: g++ doesn't push parameter decls as they are parsed. + +void (*ptr) (int foo, int array[sizeof(foo)]); +void test2 (int bar, int array[sizeof(bar)]) { }
rfg16.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } + +enum tristate { no = -1, maybe, yes }; + +void foobar () +{ + tristate var = no; // { dg-bogus "" } +}
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: hmc1.C =================================================================== --- hmc1.C (nonexistent) +++ hmc1.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// GROUPS passed templates default-arguments +template +class Klasse { +public: + void func1(int n=1); + void func2(int d) {} +}; +template +void Klasse::func1(int n) {} + +//if this is replaced by: +//void Klasse::func1(int n=1) {} +//the code compiles. + +int main() { + Klasse C; + return 0; +}
hmc1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth3.C =================================================================== --- synth3.C (nonexistent) +++ synth3.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Testcase for wrongful generation of copy constructor. + +class A { }; +class B: virtual private A { }; +class D: public B { }; // { dg-bogus "" }
synth3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: union.C =================================================================== --- union.C (nonexistent) +++ union.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: g++ doesn't insert anon union members into class scope. +// Breaks groff. + +struct A { + union { + int i; + }; + + void foo () { i = 1; } // { dg-bogus "" } +};
union.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning3.C =================================================================== --- warning3.C (nonexistent) +++ warning3.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// { dg-options "-Wshadow" } +// Bug: overloading of 'A' for template causes bogus shadowing warnings. + +template +class A +{ + public: + virtual ~A() {} +}; + +template class A;
warning3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access8.C =================================================================== --- access8.C (nonexistent) +++ access8.C (revision 338) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// From: smidt@dd.chalmers.se (Peter Smidt) +// Date: 25 Jan 1994 23:41:33 -0500 +// Bug: g++ forgets access decls after the definition. + +class inh { // { dg-error "" } inaccessible + int a; +protected: + void myf(int); +}; + +class mel : private inh { +protected: + int t; + inh::myf; +}; + +class top_t : protected mel { +public: + void myf(int); +}; + +void inh::myf(int i) { + a = i; +} + +void top_t::myf(int i) { + inh::myf(i); // { dg-error "" } cannot convert to inh + mel::myf(i); +}
access8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: c-inline.C =================================================================== --- c-inline.C (nonexistent) +++ c-inline.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: the compiler gets hopelessly confused. + +#line 1 "c-inline.h" +#pragma interface +inline double abs (double) { return 0.0; } +inline short abs (short) { return 0; } +#line 2 "c-inline.C" +extern "C" { + inline int abs (int) { return 0; } // causes segfault - +}
c-inline.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: byval3.C =================================================================== --- byval3.C (nonexistent) +++ byval3.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// Test to make sure that value return of classes with cleanups works; it +// has been broken at various times on PCC_STATIC_STRUCT_RETURN targets. + +struct A {}; + +struct R : virtual A { virtual ~R(); }; + +R g(); + +void encode() +{ + g(); +}
byval3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return3.C =================================================================== --- return3.C (nonexistent) +++ return3.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// PRMS id: 10912 + +struct A { + A() { i=10; } + int i; +}; +struct B : public A {}; +B b; + +A f() +{ + return b; +} + +int main () +{ + A a = f (); + return a.i != 10; +}
return3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested2.C =================================================================== --- nested2.C (nonexistent) +++ nested2.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// PRMS Id: 3764 (c/h) +// Bug: g++ gets into an infinite loop trying to find the top-level context + +class Menu; +class MenuItem; + +class MenuAction { +public: + virtual void execute (Menu& menu, MenuItem& menuItem) = 0; +protected: + MenuAction () {} +}; + +class Test { + class MenuCBA : public MenuAction { + public: + typedef void (Test::* MenuCBA_Member) (Menu& menu, MenuItem& menuItem); + MenuCBA (Test& instance, MenuCBA_Member member) + : _instance(&instance), _member(member) { } + void execute (Menu& menu, MenuItem& menuItem); + private: + MenuCBA_Member _member; + Test* _instance; + }; +};
nested2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg8.C =================================================================== --- rfg8.C (nonexistent) +++ rfg8.C (revision 338) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// Bug: g++ is wrongfully pedantic about union initializers. + +union U { int mbr; } array[1] = { 0 };
rfg8.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// { dg-options "-Wshadow" } + +class x { +public: + void fun(); +private: + int foo; +}; + +void x::fun() { } + +main () +{ + float foo; +}
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: access15.C =================================================================== --- access15.C (nonexistent) +++ access15.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// Bug: g++ complains about Z being a private base when trying to +// initialize B::foo. + +struct Z { + Z(); + Z(int); +}; + +struct A : private Z { }; +struct B : public A +{ + ::Z foo; + B(); + B(const B&); +}; + +B::B() : foo(1) { } // { dg-bogus "" }
access15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: this.C =================================================================== --- this.C (nonexistent) +++ this.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 5190 +// Bug: g++ fails to build up a const reference to `this'. + +class X +{ +public: + void member (); +}; + +void print (const X* const &); + +void X::member () +{ + print (this); +}
this.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtor.C =================================================================== --- dtor.C (nonexistent) +++ dtor.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +struct A { + ~A(); +}; + +struct B { + ~B(); +}; + +int main() +{ + A a; + a.~B(); // { dg-error "" } wrong name +}
dtor.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: static1.C =================================================================== --- static1.C (nonexistent) +++ static1.C (revision 338) @@ -0,0 +1,32 @@ +// { dg-do run } +// PRMS id: 6863 + +extern "C" int printf(const char *, ...); +extern "C" void abort(); + +enum ENUM {E1=0, E2 }; +int d; + +class AAA{ +public: + AAA() {a = new char[10];printf("constructor AAA() called\n");} + AAA(int) {printf("constructor AAA(int) called\n");} + ~AAA(){ printf("destructor ~AAA() called\n"); d = 1; } + operator int () { return 1;} + char *a; + int i; +}; + +struct sentinel { + ~sentinel () { if (d == 0) abort (); } +} s; + +/* forward decl here causes gcc not to execute ct and dt for arr1 */ +extern AAA arr1[]; + +AAA arr1[] = {(int)E1 }; + +int main() +{ + return 0; +}
static1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual2.C =================================================================== --- virtual2.C (nonexistent) +++ virtual2.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do run } +struct A { + virtual A* f () { return this; } +}; + +struct B: public A { + virtual B* f () { return 0; } +}; + +int main () +{ + A* ap = new B; + return (ap->f () != 0); +}
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: scoping16.C =================================================================== --- scoping16.C (nonexistent) +++ scoping16.C (revision 338) @@ -0,0 +1,5 @@ +// { dg-do assemble } +struct A { + int a(); // { dg-error "" } + int a; // { dg-error "" } +};
scoping16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offset4.C =================================================================== --- offset4.C (nonexistent) +++ offset4.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ complains about the use of A::p below. + +struct A { + void *p; +}; + +struct B: public A { + int f () + { + if (A::p) + return 1; + return 0; + } +};
offset4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mutable1.C =================================================================== --- mutable1.C (nonexistent) +++ mutable1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do run } +struct X +{ + X () { } + mutable int x; +}; + +int main () +{ + const X x; + x.x = 0; +}
mutable1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: thunk1.C =================================================================== --- thunk1.C (nonexistent) +++ thunk1.C (revision 338) @@ -0,0 +1,47 @@ +// { dg-do run } +// Test that non-variadic function calls using thunks work right. + +struct A { + void* p; + A (void* q): p (q) { } + A (const A& a): p (a.p) { } +}; + +class CBase { +public: + virtual void BaseFunc(); +}; + +class MMixin { +public: + virtual A MixinFunc(int arg, A arg2) = 0; +}; + +class CExample : public CBase, public MMixin { +public: + A MixinFunc(int arg, A arg2); +}; + +void CBase::BaseFunc() +{ +} + +A CExample::MixinFunc(int arg, A arg2) +{ + if (arg != 1 || arg2.p != 0) + return 0; + return this; +} + +void* test(MMixin& anExample) +{ + return anExample.MixinFunc(1,A(0)).p; +} + +int main () +{ + CExample c; + + if (test(c) != &c) + return 1; +}
thunk1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new4.C =================================================================== --- new4.C (nonexistent) +++ new4.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do run } +// { dg-options "-fcheck-new" } + +struct A { + A(): i(42) { } + A(int j): i(j) { } + int i; +}; + +A* ap = new A (1); +A* ap2 = new A[3]; + +main () +{ + if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42) + return 1; + + A* ap = new A (1); + A* ap2 = new A[3]; + + if (ap->i != 1 || ap2[0].i != 42 || ap2[1].i != 42 || ap2[2].i != 42) + return 1; +}
new4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse13.C =================================================================== --- parse13.C (nonexistent) +++ parse13.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } + +struct A { + struct B {}; + struct C; +}; + +struct A :: C : A :: B {}; // { dg-bogus "" } parse error before `:'
parse13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dcast3.C =================================================================== --- dcast3.C (nonexistent) +++ dcast3.C (revision 338) @@ -0,0 +1,33 @@ +// { dg-do run } +// Testcase for tricky dynamic cast situations. + +struct A { + virtual void f () { } +}; + +struct B : public A { }; +struct C : public B { }; +struct D : public B { }; +struct E : public C, public D { }; + +struct B2 : public virtual A { }; +struct C2 : public B2 { }; +struct D2 : public B2 { }; +struct E2 : public C2, public D2 { }; + +int main () +{ + E e; + E2 e2; + + A* ap = (C*)&e; + + // ap points to base subobject of unique B; succeeds + if (dynamic_cast (ap) == 0) + return 1; + + ap = (C2*)&e2; + // ap points to base subobject shared by two Bs; fails + if (dynamic_cast (ap) != 0) + return 2; +}
dcast3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template42.C =================================================================== --- template42.C (nonexistent) +++ template42.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do run } +// Testcase for not evaluating template default args if they are +// never used. + +struct X { + X(int) { } +}; + +template +struct A { + void f (T t = T()) { } +}; + +int main () +{ + A a; + X x (1); + a.f (x); +}
template42.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmem4.C =================================================================== --- pmem4.C (nonexistent) +++ pmem4.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +struct X {}; +X& X::*PTM_1; // { dg-error "" } pointer to reference member +void X::*PTM_2; // { dg-error "" } pointer to void member + +struct A { + static int& ir; +}; + +int i; +int& A::ir = i; // not an error
pmem4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template25.C =================================================================== --- template25.C (nonexistent) +++ template25.C (revision 338) @@ -0,0 +1,49 @@ +// { dg-do run } +// PRMS Id: 6393 +// Bug: g++ is too lax in considering UPTs to be the same. + +template +class Bar +{ +public: + R do_bar (T arg); +}; + + +template +class Foo +{ + T i; + +public: + void do_foo () {} + void do_foo (T const & t) {} + void do_foo (Bar const & bar); // {} Put the body here and it works + void do_foo (Bar const & bar); // {} Put the body here and it works +}; + +// These definitions don't work + +template +inline void Foo:: +do_foo (Bar const & bar) +{} + +template +inline void Foo:: +do_foo (Bar const & bar) +{} + + +int main () +{ int i; + Bar bar1; + Bar bar2; + Foo foo; + foo.do_foo(); + foo.do_foo(i); + foo.do_foo(bar1); + foo.do_foo(bar2); + + return 0; +}
template25.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typedef3.C =================================================================== --- typedef3.C (nonexistent) +++ typedef3.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Test that inheriting from a type typedefed to itself works. + +typedef struct class1 { + class1& operator=(const class1&); +} class1; + +class class2 : public class1 { };
typedef3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload27.C =================================================================== --- overload27.C (nonexistent) +++ overload27.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do run } +void f(const int &) { } +void f(const float &); + +int main() +{ + f(false); // { dg-bogus "" } +}
overload27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping2.C =================================================================== --- scoping2.C (nonexistent) +++ scoping2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: A function is not hidden properly by a use of its name in an +// inner scope. + +struct A +{ + struct B + { + int f; + B() : f(0) {} + void g() { f = 0; } + }; + void f(); + void f(int); +};
scoping2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg25.C =================================================================== --- rfg25.C (nonexistent) +++ rfg25.C (revision 338) @@ -0,0 +1,2 @@ +// { dg-do assemble } +struct { int :0; }; /* { dg-error "" } anon struct not used to declare objects */
rfg25.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,4 @@ +// { dg-do assemble } +struct A { int i; }; + +A a = {{{1}}}; // { dg-error "" } causes abort
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: anon.C =================================================================== --- anon.C (nonexistent) +++ anon.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do run } +// Bug: g++ has trouble copying anonymous structs. + +typedef struct { int i; } foo; +struct A : public foo { + struct { int i; } x; +}; + +int main () +{ + A a; + a.i = 5; + a.x.i = 42; + A b (a); + a = b; + if (a.i != 5 || a.x.i != 42) + return 1; + return 0; +}
anon.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtor3.C =================================================================== --- dtor3.C (nonexistent) +++ dtor3.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do assemble } +// PRMS Id: 5341 +// Bug: g++ complains about the explicit destructor notation. + +#include + +void *operator new(size_t Size, void* pThing) { return pThing; } + +template class Stack { +public: + Stack() { new (Data) T(); } + ~Stack() { ((T*)Data)->~T(); } +private: + char Data[sizeof(T)]; +}; + +Stack a; +Stack > c;
dtor3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 2371.C =================================================================== --- 2371.C (nonexistent) +++ 2371.C (revision 338) @@ -0,0 +1,551 @@ +// { dg-do run } +// { dg-options "" } +# 1 "SetLS.cc" +// GROUPS passed templates nested-classes +// +// The SetLS template test +// +// Wendell Baker, Berkeley CAD Group, 1993 (wbaker@ic.Berkeley.EDU) +// + +#pragma implementation "ListS.h" +#pragma implementation "SetLS.h" + +#include +#include +using namespace std; + +# 1 "../../templates/SetLS.h" 1 +// -*- C++ -*- + + + +// +// A Set Template - implemented with an ListS +// +// Wendell Baker, Berkeley CAD Group, 1993 (wbaker@ic.Berkeley.EDU) +// + + + + + +#pragma interface + + + + + +#define XTRUE true +#define XFALSE false + +# 37 "../../templates/SetLS.h" + + +# 1 "../../templates/ListS.h" 1 +// -*- C++ -*- + + + +// +// A List Template - providing a singly linked capability +// +// Wendell Baker, Berkeley CAD Group, 1993 (wbaker@ic.Berkeley.EDU) +// + + + + + +#pragma interface + + + + + + +# 1 "/projects/gnu-cygnus/gnu-cygnus-14/mips/lib/gcc-lib/decstation/cygnus-reno-1/g++-include/bool.h" 1 3 +// Defining XTRUE and XFALSE is usually a Bad Idea, +// because you will probably be inconsistent with anyone +// else who had the same clever idea. +// Therefore: DON'T USE THIS FILE. + + + + + + + + + +# 23 "../../templates/ListS.h" 2 + +# 37 "../../templates/ListS.h" + + + +// g++ reno-1 is not yet capable of creating templates with nested +// classes which instantiate the template arguments. +template +struct ListS_link { + T item; + ListS_link *next; + + ListS_link(const T& i, ListS_link *n = 0): item(i), next(n) + { } +}; + + +// +// For now, errors are raised by ::abort() because exceptions +// are not well implemented in cxx or at all in CC 3.0.1 +// +template +class ListS { +public: + ListS(); + ListS(const ListS&); + ~ListS(); + + void operator=(const ListS&); + + unsigned length() const + { return count; } + + void prepend(const T& item); + void append(const T& item); + void clear(); + + const T& head() const + { ensure_1(); + return head_link->item; } + T& head() + { ensure_1(); + return head_link->item; } + void head(T& fill) const + { ensure_1(); + fill = head_link->item; } + void remove_head() + { remove_head_filling(0); } + void remove_head(T& fill) + { remove_head_filling(&fill); } + + const T& tail() const + { ensure_1(); + return tail_link->item; } + T& tail() + { ensure_1(); + return tail_link->item; } + void tail(T& fill) const + { ensure_1(); + fill = tail_link->item; } + + class Vix { + public: + Vix(): owner(0), index(0) + { } + + // These are friend functions so that v == x is the same as x == v + friend int operator==(void *v, const Vix& x) + { return v == x.index; } + friend int operator==(const Vix& x, void *v) + { return v == x.index; } + friend int operator!=(void *v, const Vix& x) + { return v != x.index; } + friend int operator!=(const Vix& x, void *v) + { return v != x.index; } + friend int operator==(const Vix& x1, const Vix& x2) + { return x1.owner == x2.owner && x1.index == x2.index; } + friend int operator!=(const Vix& x1, const Vix& x2) + { return x1.owner != x2.owner || x1.index != x2.index; } + private: + friend class ListS; + + + Vix(const ListS *o, ListS_link *i): owner(o), index(i) + { } + + + + + + const ListS *owner; + + ListS_link *index; + + + + }; + + Vix first() const + { return Vix(this, head_link); } + void next(Vix& x) const + { check(x); + if (x.index != 0) + x.index = x.index->next; } + T& operator()(const Vix& x) + { check(x); + return x.index->item; } + const T& operator()(const Vix& x) const + { check(x); + return x.index->item; } +protected: +# 154 "../../templates/ListS.h" + + + unsigned count; + + ListS_link *head_link; // 0 for a zero-length list + ListS_link *tail_link; // 0 for a zero-length list + + + + + +private: + // fill may be 0 (then don't fill) + void remove_head_filling(T *fill); + + void ensure_1() const + { if (0 == head_link) + ::abort(); } + void check(const Vix& x) const + { if (this != x.owner) + ::abort(); + if (0 == x.index) + ::abort(); } +}; + +template +ListS::ListS(): +count(0), +head_link(0), +tail_link(0) +{ } + +template +ListS::ListS(const ListS& other): +count(0), +head_link(0), +tail_link(0) +{ + for (Vix x=other.first(); 0 != x; other.next(x)) + append(other(x)); +} + +template +ListS::~ListS() +{ + clear(); +} + +template +void +ListS::operator=(const ListS& other) +{ + clear(); + for (Vix x=other.first(); 0 != x; other.next(x)) + append(other(x)); +} + +template +void +ListS::prepend(const T& item) +{ + + head_link = new ListS_link(item, head_link); + + + + if (0 == tail_link) + tail_link = head_link; + count++; +} + +template +void +ListS::append(const T& item) +{ + + ListS_link *new_link = new ListS_link(item); + + + + if (0 == tail_link) { + head_link = new_link; + tail_link = new_link; + } else { + tail_link->next = new_link; + tail_link = tail_link->next; + } + count++; +} + +template +void +ListS::clear() +{ + + ListS_link *next, *l; + + + + for (l=head_link; 0 != l; l=next) { + next = l->next; + delete l; + } + + count = 0; + head_link = 0; + tail_link = 0; +} + +template +void +ListS::remove_head_filling(T* fill) +// fill may be 0 in which case don't assign into it +{ + ensure_1(); + + ListS_link *ohead = head_link; + + + + if (0 != fill) + *fill = ohead->item; + head_link = ohead->next; + if (0 == head_link) + tail_link = 0; + count--; + delete ohead; +} + + +# 40 "../../templates/SetLS.h" 2 + + +# 62 "../../templates/SetLS.h" + +template +class SetLS { +public: + SetLS(); + + void add(const T& item); + // There is no remove(const T& item) for this set + bool contains(const T& item) const; + + unsigned length() const + { return list.length(); } + + void clear() + { list.clear(); } + + class Vix { + public: + Vix(): owner(0), vix() + { } + + // These are friend functions so that v == x is the same as x == v + friend int operator==(void *v, const Vix& x) + { return v == x.vix; } + friend int operator==(const Vix& x, void *v) + { return v == x.vix; } + friend int operator!=(void *v, const Vix& x) + { return v != x.vix; } + friend int operator!=(const Vix& x, void *v) + { return v != x.vix; } + friend int operator==(const Vix& x1, const Vix& x2) + { return x1.owner == x2.owner && x1.vix == x2.vix; } + friend int operator!=(const Vix& x1, const Vix& x2) + { return x1.owner != x2.owner || x1.vix != x2.vix; } + private: + friend class SetLS; + + Vix(const SetLS *o, const typename ListS::Vix& x): owner(o), vix(x) + { } + + const SetLS *owner; + typename ListS::Vix vix; + }; + friend class Vix; + + Vix first() const + { return Vix(this, list.first()); } + void next(Vix& x) const + { check(x); + list.next(x.vix); } + const T& operator()(const Vix& x) const + { check(x); + return list(x.vix); } + // There is item no remove(const Vix&) for this set +protected: + ListS list; + +private: + void check(const Vix& x) const + { if (this != x.owner) + ::abort(); } +}; + + +template +SetLS::SetLS(): + + + +list() + +{ } + +template +void +SetLS::add(const T& item) +{ + if ( ! contains(item) ) { + + + + list.append(item); + + } +} + +template +bool +SetLS::contains(const T& item) const +{ + for (Vix x=first(); 0 != x; next(x)) { + if (operator()(x) == item) + return XTRUE; + } + return XFALSE; +} + + +# 17 "SetLS.cc" 2 + + + +// In (most versions of) g++ 2.X, this use of typedefs has the effect +// of causing the instantiation of the templates, thereby testing the +// templates + +class test { +public: + test(): value(0) + { } + test(int v): value(v) + { } + + void print(ostream& out) const + { out << value; } + + friend int operator==(const test& a, const test& b); +private: + int value; +}; + +int +operator==(const test& a, const test& b) +{ + return a.value == b.value; +} + +ostream& +operator<<(ostream& o, const test& t) +{ + t.print(o); + return o; +} + +typedef SetLS SLS; + +static ostream& +operator<<(ostream& o, const SLS& s) +{ + o << "set of " << s.length() << " = {"; + + bool first; + SetLS::Vix x; + for (first=XTRUE, x=s.first(); 0 != x; s.next(x), first=XFALSE) { + if ( ! first ) + o << ','; + o << ' '; + s(x).print(o); + } + o << '}'; + + return o; +} + +SLS gsls; +const SLS gcsls; + +void foo() +{ + const unsigned SIZE = 20; + + // + // SetLS() + // SetLS(const SetLS&) + // + SLS sls; + { + // Fill sls with some interesting values + for (unsigned i=0; i&); + // + sls = csls; + + // + // bool contains(const T& item) const + // + for (unsigned i=0; i::Vix cx; + for (cx=csls.first(); 0 != cx; sls.next(cx)) { + if ( ! sls.contains(csls(cx)) ) + ::abort(); + } + + cout << "gsls:\t" << gsls << '\n'; + cout << "gcsls:\t" << gcsls << '\n'; + cout << "sls:\t" << sls << '\n'; + cout << "csls:\t" << csls << '\n'; +} + +// Dummy function so it'll run +int main() +{ + cout << "PASS" << endl; +} + +template class ListS;
2371.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload1.C =================================================================== --- overload1.C (nonexistent) +++ overload1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ thinks there is a conversion from void * to B *. + +struct A { + operator void* (); +}; + +struct B: public A { }; + +void bar (A& a) { + B* bp = (B*)a; // { dg-error "" } +}
overload1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: destruct.C =================================================================== --- destruct.C (nonexistent) +++ destruct.C (revision 338) @@ -0,0 +1,34 @@ +// { dg-do assemble } +// Exhaustive test for destructors of simple types. +// PRMS Id: 2744, 3308 + +template class A { + T q; +public: + ~A() { + q.T::~T(); + q.~T(); + (&q)->T::~T(); + (&q)->~T(); + } +}; + +typedef char * cp; +typedef int I; + +int main () +{ + A a; + A b; + int i; + cp c; + + i.~I(); + i.I::~I(); + (&i)->~I(); + (&i)->I::~I(); + c.~cp(); + c.cp::~cp(); + (&c)->~cp(); + (&c)->cp::~cp(); +}
destruct.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse3.C =================================================================== --- parse3.C (nonexistent) +++ parse3.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// PRMS Id: 4484 (bug 2) +// Bug: g++ does not grok abstract declarator syntax for method pointers. + +template class A { }; +void (A::*p)() = (void (A::*)())0; // { dg-bogus "" } abstract declarator failure
parse3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref4.C =================================================================== --- ref4.C (nonexistent) +++ ref4.C (revision 338) @@ -0,0 +1,4 @@ +// { dg-do assemble } + +void f (); +void (&fr)() = f;
ref4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template7.C =================================================================== --- template7.C (nonexistent) +++ template7.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// PRMS Id: 4826 + +class A; +template void f(const T&, const T&); + +void g (const A& a, A& b) { + f (a, b); // { dg-bogus "" } failed unification +}
template7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash11.C =================================================================== --- crash11.C (nonexistent) +++ crash11.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// Bug: g++ crashes on this input. + +struct A { + const char *p; +}; +const char foo[] = "bar"; +const A a = { foo }; +extern const A* ap = &a; //{ dg-warning "'ap' initialized and declared 'extern'" }
crash11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload9.C =================================================================== --- overload9.C (nonexistent) +++ overload9.C (revision 338) @@ -0,0 +1,39 @@ +// { dg-do assemble } +// PRMS Id: 4257 +// Bug: g++ ignores non-member possibilities (ideal_candidate_ansi bug) + +class ostream +{ +public: +#ifdef EITHER_ONE_A + ostream& operator<<(unsigned long n); + ostream& operator<<(long n); +#else + ostream& operator<<(short n); + ostream& operator<<(unsigned short n); +#endif +}; + +class ccObjectInfo {}; + +ostream& operator << (ostream& out, const ccObjectInfo& obj); + +class ccString : public ccObjectInfo +{ +#ifdef EITHER_ONE_B + operator int () const; +#else + operator long () const; +#endif +}; + +// Should pick this one!! +ostream& operator << (ostream& o, const ccString & s); + +extern ostream cout; + +void f () +{ + ccString foo; + cout << foo; +}
overload9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cond2.C =================================================================== --- cond2.C (nonexistent) +++ cond2.C (revision 338) @@ -0,0 +1,66 @@ +// { dg-do run } +// Positive testcase for decls in conditions. + +extern "C" int printf(const char *, ...); + +int up = 0; +int down = 0; + +struct T +{ + int i; + T(int j) { i = j; printf("UP\n"); up++; } + T(const T& t) { i = t.i; printf("unwanted copy\n"); } + ~T() { printf ("DOWN\n"); down++; } + operator int () { return i; } +}; + +int main () +{ + int t; + + if (T t = 1) + ; + + printf ("\n"); + + int j = 3; + while (T t = j--) + ; + + printf ("\n"); + + j = 3; + while (1) + { + T t = j--; + if (t) continue; + break; + } + + printf ("\n"); + + j = 3; + for (;T t = j--;) + ; + + printf ("\n"); + + for (int k = 3; T t = k--;) + ; + + printf ("\n"); + + switch (T t = 34) + { + case 34: + ; + } + + printf ("\n"); + + if (up == down && up == 18) + return 0; + else + return 1; +}
cond2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: builtin.C =================================================================== --- builtin.C (nonexistent) +++ builtin.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "-w" } +// Bug: g++ overloads strlen instead of bashing the builtin version. + +extern "C" void strlen (const char *); + +void f () +{ + strlen("Hi"); +}
builtin.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access24.C =================================================================== --- access24.C (nonexistent) +++ access24.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: forward reference to friend doesn't work in template. + +template class A { + static int i; + friend struct B; +}; + +struct B { + void f () { A::i = 0; } +};
access24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const2.C =================================================================== --- const2.C (nonexistent) +++ const2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do run } +// Example of static member constants + +extern "C" int printf (const char *, ...); + +struct T { + static const char letter = 'a'; // this is the new stuff! + char x[letter]; + void f(); +}; + +void T::f() { printf ("%p", &letter); } +const char T::letter; // still need def after class + +int main() { }
const2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion5.C =================================================================== --- conversion5.C (nonexistent) +++ conversion5.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-Wconversion" } +struct A { }; +struct B: public A { + A a; + operator A () { return a; } // { dg-warning "" } never used implicitly +}; +void f (const A&); +void g() +{ + B b; + (A) b; // { dg-bogus "" } trying both constructor and type conversion operator +}
conversion5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opover.C =================================================================== --- opover.C (nonexistent) +++ opover.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ prefers a non-matching operator== over user-defined conversions +// and a default operator==. + +struct A { + operator int (); +}; + +struct B { + friend int operator== (B, int); +}; + +int foo (A& a) { + return a == 1; +}
opover.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload.C =================================================================== --- overload.C (nonexistent) +++ overload.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed overloading +enum bar {}; + +void operator+ (int, int);// { dg-error "" } .* +void operator+ (bar&, int); + +template void operator+ (int b, T& t) { return b; } +void operator+ (int, bar&); + +template class foo +{ +public: + friend void operator+ <> (int, T&); +}; + +class baz; + +class foo; +class foo;
overload.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf9.C =================================================================== --- pmf9.C (nonexistent) +++ pmf9.C (revision 338) @@ -0,0 +1,57 @@ +// { dg-do assemble } +// PRMS id: g++/13340 + +class rectangle { + +public: + rectangle(); + int overlaps() const; + +}; + +class region +{ + friend class region_impl; + +public: + region(); + typedef int (region::* region_func)() const; + +}; + +class region_impl { + friend class region; + +private: + rectangle content, mbb; + region_impl *link_p; + region_impl(const rectangle &content); + +public: + int iterate(region *region_p, region::region_func what, + const rectangle &clip_rect) const; + int iterate(region *region_p, region::region_func what, + const region_impl &clip_rgn) const; +}; + + +int +region_impl::iterate (region *region_p, region::region_func what, + const rectangle &clip_rect) const +{ + for (const region_impl *p = this; p != 0 && p->mbb.overlaps(); + p = p->link_p) + if (p->content.overlaps()) + if (!(region_p->*what)()) return 0; + return 1; +} + +int +region_impl::iterate (region *region_p, region::region_func what, + const region_impl &clip_rgn) const +{ + for (const region_impl *p = this; p != 0 && p->mbb.overlaps(); + p = p->link_p) + if (!clip_rgn.iterate(region_p, what, p->content)) return 0; + return 1; +}
pmf9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cast3.C =================================================================== --- cast3.C (nonexistent) +++ cast3.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 7088 + +struct string +{ + int length () const; + string (string &); + string (char * = 0); + int operator [] (int); + ~string (); +}; + +void _cook(const string raw, bool for_postscript) +{ + unsigned char c = (unsigned) ((string &)raw)[1]; +}
cast3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload11.C =================================================================== --- overload11.C (nonexistent) +++ overload11.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do run } +// PRMS Id: 4697 +// Bug: g++ calls the non-const method for a const object. + +class A { +public: + void foo(int &i) const { i = 0; } + void foo(int &i) { i = 1; } +}; + +int main() +{ + A a; + const A& b = a; + int i = 2; + b.foo (i); + return i; +}
overload11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template34.C =================================================================== --- template34.C (nonexistent) +++ template34.C (revision 338) @@ -0,0 +1,25 @@ +// { dg-do run } +template +class Set { + public: + typedef int (*Compare)(const T&, const T&); + static Compare cmp1; + static int (*cmp2)(const T&, const T&); +}; + +template +int gen_cmp(const T& a, const T& b) { + if (a +typename Set::Compare Set::cmp1 = &gen_cmp; + +template +int (*Set::cmp2)(const T&, const T&) = &gen_cmp; + +int main() { + Set s; +}
template34.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// Bug: access declarations are broken. + +class A { +public: + void foo (); +}; + +class B: private A { +public: + A::foo; +}; + +void foo() { + B b; + b.foo (); // { dg-bogus "" } +}
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: bool7.C =================================================================== --- bool7.C (nonexistent) +++ bool7.C (revision 338) @@ -0,0 +1,29 @@ +// { dg-do assemble } + +struct A +{ + operator bool () const; + operator const void * () const; +}; + +struct B +{ + A a; + int foo1 (); + int foo2 (); +}; + +int +B::foo1 () +{ + return a ? 0 : 1; // ambiguous default type conversion for `operator !=' +} + +int +B::foo2 () +{ + if (a) + return 0; + else + return 1; +}
bool7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template17.C =================================================================== --- template17.C (nonexistent) +++ template17.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Caught by Booch Components. +// Bug: g++ tries to instantiate nested enums. + +template struct A +{ + struct B { }; + enum C { c }; +}; + +template struct A;
template17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash4.C =================================================================== --- crash4.C (nonexistent) +++ crash4.C (revision 338) @@ -0,0 +1,38 @@ +// { dg-do assemble } +// PRMS Id: 4346 +// Bug: g++ dies on redefinition of cc_Array::repInvariant. + +class ccObjectInfo +{ +public: + virtual const ccObjectInfo& repInvariant (int =0) const; +}; + +template +class cc_Array : public ccObjectInfo +{ +public: + virtual const ccObjectInfo& repInvariant (int =0) const ; +}; + +template +const ccObjectInfo& cc_Array::repInvariant(int) const // { dg-error "previously declared" } +{ return *this /* *this is required here */; } + +template +class ccArray :public ccObjectInfo +{ + ccArray (cc_Array*); +}; + +template +class ccObjArray : public ccArray +{ + ccObjArray(); +}; + +template +const ccObjectInfo& cc_Array::repInvariant(int) const // { dg-error "redefinition" } +{ return 0; } + +typedef ccObjArray< double> ccROIRuns;
crash4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload36.C =================================================================== --- overload36.C (nonexistent) +++ overload36.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do run } +// Test for subsequence checking in overload resolution. + +class foo { +public: + void operator <<(char *) { } + void operator <<(const char * const &); +}; + +int +main() +{ + char s[20]; + foo f; + f << s; +}
overload36.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload19.C =================================================================== --- overload19.C (nonexistent) +++ overload19.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do run } +// PRMS Id: 4689 +// Bug: g++ doesn't notice operators overloaded on enumeral types. + +enum E { A=5, B=32, C=100 }; + +E operator|(E a, E b) { return C; } + +int main() +{ + return (A|B) != C; +}
overload19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg17.C =================================================================== --- rfg17.C (nonexistent) +++ rfg17.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// The default assignment operator for B uses array assignment, so we can't +// just disallow it... + +struct A { A& operator=(const A&); }; +struct B { A f[20]; }; + +int a1[20], a2[20]; +B b1, b2; + +void +test () +{ + b1 = b2; /* OK */ + a1 = a2; /* { dg-error "" } array assignment */ +}
rfg17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion10.C =================================================================== --- conversion10.C (nonexistent) +++ conversion10.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// PRMS Id: 9019 +// Bug: g++ doesn't find conversion to const char *. + +struct String { + String (); + explicit String (const char *); + operator const char * (); +}; + +int main(int argc, char **argv) +{ + String deflt("no args"); + String useme; + + const char *p = (argv[1]) ? argv[1] : deflt; + + return 0; +}
conversion10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq2.C =================================================================== --- opeq2.C (nonexistent) +++ opeq2.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do assemble } +// Bug: default operator= is not being generated properly. +// PRMS Id: 3525 + +struct ccUnwind +{ + ccUnwind& operator = (const ccUnwind&); +}; + +struct ccEllipseUnit +{ + ccEllipseUnit () {} +}; + +struct ccEllipse : ccUnwind +{ + ccEllipse (); + ccEllipse (const ccEllipseUnit&); + +}; + +void foo () +{ + ccEllipse e; + e = ccEllipseUnit(); // { dg-bogus "" } assignment not defined +}
opeq2.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// { dg-options "-Wall" } + +enum tristate { no = -1, maybe, yes }; + +tristate +tristate_satisfies (register tristate const t1, register tristate const t2) +{ + switch (t1) + { + case no: + return (tristate) -t2; + case maybe: + return yes; + case yes: + return t2; + } + return maybe; +}
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: warning4.C =================================================================== --- warning4.C (nonexistent) +++ warning4.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// { dg-options "-Woverloaded-virtual" } +// Bug: a virtual function with the same name in an unrelated class will +// cause a bogus overloading warning. + +struct A { + virtual void foo (); +}; + +struct B { + virtual void bar (); +}; + +struct C: public A { + virtual void bar (); +};
warning4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth4.C =================================================================== --- synth4.C (nonexistent) +++ synth4.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } + +struct X { + X(); +}; +typedef void (X::*mfp)(); +struct Y { + Y(); + mfp memfp; +}; +void f() +{ + Y *y1, *y2 ; + *y1 = *y2; // { dg-bogus "" } failed to synthesize op= +}
synth4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access9.C =================================================================== --- access9.C (nonexistent) +++ access9.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// Bug: g++ doesn't allow const objects to be constructed. + +struct B { B(); }; + +const B foo() +{ + return B(); // { dg-bogus "" } constructing const +}
access9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg1.C =================================================================== --- rfg1.C (nonexistent) +++ rfg1.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// Bug: g++ parses the declaration of i as a functional cast. + +void take_int (int arg) { } + +void +test () +{ + int (i); + + i = 0; + take_int (i); +}
rfg1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tredecl2.C =================================================================== --- tredecl2.C (nonexistent) +++ tredecl2.C (revision 338) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// No bug; making sure my fix for tredecl.C doesn't break other cases + +template struct Foo { Foo * me() { return this; } }; +Foo i;
tredecl2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary2.C =================================================================== --- temporary2.C (nonexistent) +++ temporary2.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +class X // Indentation has been done so to see the similarities. +{ +public: + X() {} // { dg-message "note" } referenced below + X(X& x) {x.i=7;} // { dg-message "note" } Both functions modify the + void bar(X& x) {x.i=7;} // { dg-message "note" } reference parameter x. + int i; +}; + +X foo() { X x; return x; } + +int main() +{ + X x(foo()); // { dg-error "no match" } Compiler doesn't warn about temporary reference. + x.bar(foo()); // { dg-error "no match" } The same mistake is warned about in this case. +}
temporary2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth.C =================================================================== --- synth.C (nonexistent) +++ synth.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// Bug: the synthesized copy constructor for A is not found. + +struct A { + // A (const A& a): i(a.i) {} + int i; +}; + +struct B { + A a; + B (const B& b): a(b.a), j(b.j) { } // { dg-bogus "" } + int j; +};
synth.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg9.C =================================================================== --- rfg9.C (nonexistent) +++ rfg9.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +int cond; +int i; +int *ip; + +void +test () +{ + cond ? i : ip; /* { dg-error "" } pointer/integer mismatch */ +}
rfg9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access16.C =================================================================== --- access16.C (nonexistent) +++ access16.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// Bug: g++ uses the same binfo for the a subobject of c and the a subobject +// of b, so basetype_paths get bashed improperly. + +class a { +protected: + virtual void foo() { } // { dg-bogus "" } +}; + +class b : public virtual a {}; + +class c : public b { +public: + void bar() { b::foo(); } // { dg-bogus "" } +}; + +int main() { + c test; + test.bar(); +}
access16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping17.C =================================================================== --- scoping17.C (nonexistent) +++ scoping17.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do run } +// Test that the integer hides the struct in block scope. + +int main () +{ + int A; + struct A { }; + A = 1; +}
scoping17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: thunk2.C =================================================================== --- thunk2.C (nonexistent) +++ thunk2.C (revision 338) @@ -0,0 +1,49 @@ +// { dg-do run { target fpic } } +// { dg-options "-fPIC" } +// { dg-skip-if "requires unsupported run-time relocation" { spu-*-* } { "*" } { "" } } +// Test that non-variadic function calls using thunks and PIC work right. + +struct A { + void* p; + A (void* q): p (q) { } + A (const A& a): p (a.p) { } +}; + +class CBase { +public: + virtual void BaseFunc(); +}; + +class MMixin { +public: + virtual A MixinFunc(int arg, A arg2) = 0; +}; + +class CExample : public CBase, public MMixin { +public: + A MixinFunc(int arg, A arg2); +}; + +void CBase::BaseFunc() +{ +} + +A CExample::MixinFunc(int arg, A arg2) +{ + if (arg != 1 || arg2.p != 0) + return 0; + return this; +} + +void* test(MMixin& anExample) +{ + return anExample.MixinFunc(1,A(0)).p; +} + +main () +{ + CExample c; + + if (test(c) != &c) + return 1; +}
thunk2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon2.C =================================================================== --- anon2.C (nonexistent) +++ anon2.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// g++ should not complain about anonymous bitfields. + +struct A +{ + int : 2; +};
anon2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload20.C =================================================================== --- overload20.C (nonexistent) +++ overload20.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: this code causes an internal compiler error 4. + +void f (char *); +void f (int); +struct A { + void f (); // { dg-error "" } candidate + void f (int); // { dg-error "" } candidate + void g () { + void (*p)(char *) = f; // { dg-error "" } no matching function in scope + } +};
overload20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: new5.C =================================================================== --- new5.C (nonexistent) +++ new5.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do run } +int main () +{ + const int *p = new const int (0); + delete p; +}
new5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse14.C =================================================================== --- parse14.C (nonexistent) +++ parse14.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ decides that A::foo is introducing a constructor declarator. + +struct A { + typedef bool foo; +}; + +A::foo (*bar) (); + +struct B { + A::foo (*bar) (); +};
parse14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template43.C =================================================================== --- template43.C (nonexistent) +++ template43.C (revision 338) @@ -0,0 +1,31 @@ +// { dg-do run } +// Test matching of partial specializations. + +template +class EQUAL { +public: + enum { value = 0 }; +}; +template +class EQUAL { +public: + enum { value = 1 }; +}; + +int x; +int y; + +int equals_x_x = EQUAL<&x,&x>::value; // expected value: 1 +int equals_x_y = EQUAL<&x,&y>::value; // expected value: 0 +int equals_y_x = EQUAL<&y,&x>::value; // expected value: 0 +int equals_y_y = EQUAL<&y,&y>::value; // expected value: 1 + +int main () +{ + if (equals_x_x == 1 + && equals_x_y == 0 + && equals_y_x == 0 + && equals_y_y == 1) + return 0; + return 1; +}
template43.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template26.C =================================================================== --- template26.C (nonexistent) +++ template26.C (revision 338) @@ -0,0 +1,115 @@ +// { dg-do run } +// PRMS Id: 6275 +// Bug: unification fails for call to find_parameter_in_stack. + +#include +#include + +const int max_stack_size = 20; + +template +class Stack { + private: + T objects[max_stack_size]; + int nobjects; + public: + Stack(): nobjects(0) {} + void push(const T&a) { + if (nobjects >= max_stack_size) { + fprintf(stderr,"Stack: overflow\n"); + abort(); + } + objects[nobjects++] = a; + } + T pop() { + if (!nobjects) { + fprintf(stderr,"Stack: underflow\n"); + abort(); + } + nobjects -= 1; + T result = objects[nobjects]; + return result; + } + T top() const { + if (!nobjects) { + fprintf(stderr,"Stack: underflow\n"); + abort(); + } + return objects[nobjects - 1]; + } + int n() const { return nobjects; } + T operator[](int i) { return objects[i]; } +}; + +template +class Parameter { + T parameter_; + int is_set_; + int overrides_; + public: + Parameter(): is_set_(0), overrides_(0) {} + void set(const T& a) { parameter_ = a; is_set_ = 1; } + void override(int overrides = 1) { overrides_ = overrides; } + const T& value() const { return parameter_; } + int overrides() const { return overrides_; } + int is_set() const { return is_set_; } +}; + +template +T2 +find_parameter_in_stack(Stack& stack, Parameter& (T1::*access)()) +{ + T2 result; + int have_result = 0; + for (int i=stack.n()-1; i>=0; i--) { + if ((stack[i].*access)().is_set()) { + if (!have_result || (stack[i].*access)().overrides()) { + result = (stack[i].*access)().value(); + have_result = 1; + } + } + } + return result; +} + +class A { + private: + Parameter a_; + public: + A() { } + Parameter& a() { return a_; } +}; + +int +main(int, char**) +{ + Stack A_stack; + A a1; + A a2; + a1.a().set(1); + a2.a().set(2); + A_stack.push(a1); + A_stack.push(a2); + + int val = find_parameter_in_stack(A_stack, &A::a); + + printf("val = %d\n", val); + if (val != 2) + return 1; + + A_stack.pop(); + A_stack.pop(); + + a1.a().override(); + + A_stack.push(a1); + A_stack.push(a2); + + val = find_parameter_in_stack(A_stack, &A::a); + + printf("val = %d\n", val); + if (val != 1) + return 1; + + return 0; +}
template26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: context.C =================================================================== --- context.C (nonexistent) +++ context.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 3988 +// Bug: DECL_CONTEXT of A::B gets clobbered in pushdecl when defining A::foo(). + +#pragma implementation "context.h" +#line 1 "context.h" +#pragma interface + +template +struct A { + inline void foo () { } + class B { }; +}; + +struct C : public A { + void bar (C::B&); +}; +#line 2 "context.C" + +void C::bar (C::B& b) { }
context.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping3.C =================================================================== --- scoping3.C (nonexistent) +++ scoping3.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ does not grok nested types very well. + +class A { + class B; + friend class B; + class B { }; // { dg-bogus "" } +};
scoping3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload28.C =================================================================== --- overload28.C (nonexistent) +++ overload28.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 6056 + +struct Foo { + Foo() { } // { dg-message "note" } + Foo(int i = 25) { } // { dg-message "note" } +}; + +int main() +{ + Foo* f1 = new Foo(); // { dg-error "ambiguous" } +}
overload28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg26.C =================================================================== --- rfg26.C (nonexistent) +++ rfg26.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +typedef void (FTYPE) (); + +FTYPE f; /* ok */ + +void +test_0 () +{ + (FTYPE) f; /* { dg-error "" } casting to function type */ +}
rfg26.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: dtor4.C =================================================================== --- dtor4.C (nonexistent) +++ dtor4.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// PRMS Id: 5420 +// Bug: g++ gets mixed up calling destructors for references. + +template +class Z { +public: + char space[100]; + void kill() + { X& x = (X&) space[0]; + x.~X(); } +}; + +class C { int i; }; + +void +f() +{ + Z r; + r.kill(); + Z s; + s.kill(); +}
dtor4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: 3523.C =================================================================== --- 3523.C (nonexistent) +++ 3523.C (revision 338) @@ -0,0 +1,40 @@ +// { dg-do assemble } +// GROUPS passed assignment +class ccUnwind +{ +public: + virtual ~ccUnwind (); // comment out virtual, and void diag changes +}; + +template +class ccHandle : public ccUnwind // similarly comment out inheritance +{ +public: + ccHandle& operator = (const ccHandle& h); +}; + +class cc_Image; + +class ccImage : public ccHandle +{ +public: +// reversing the order of the next two lines changes the diagnostic +// printed about the def of ccDisplay::image + ccImage (const ccImage &); + ccImage (const cc_Image &); +}; + +class ccDisplay +{ +public: + ccImage img; +//ccImage image ( ccImage i) {img = i; return img;} +// above line compiles + ccImage image ( ccImage i) { return img = i;} /* this gets void* error */ +}; + + + +// vd.C: In method `class ccImage ccDisplay::image (class ccImage)': +// vd.C:31: bad argument 1 for function `ccImage::ccImage (const class cc_Image&)' (type was void *) +// vd.C:31: in base initialization for class `ccImage'
3523.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload2.C =================================================================== --- overload2.C (nonexistent) +++ overload2.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: foo and bar are considered to be overloaded (i.e. their +// IDENTIFIER_GLOBAL_VALUES are TREE_LISTs) even though they aren't, +// so ?: thinks it can't resolve the names. + +void foo (); +void bar (); + +void baz () +{ + void (*p)() = 1 ? foo : bar; // { dg-bogus "" } wrongful overloading +}
overload2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: soverload.C =================================================================== --- soverload.C (nonexistent) +++ soverload.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: dfs_pushdecls doesn't create an overload list for member functions, +// like it claims to. + +struct A +{ + static int foo (int); + static int foo (int, int); + void bar () { foo (1, 2); } // { dg-bogus "" } broken overloading +};
soverload.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse4.C =================================================================== --- parse4.C (nonexistent) +++ parse4.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Bug: g++ doesn't handle superfluous parentheses when redeclaring a TYPENAME. + +typedef int foo; +class A { + typedef int ((foo)); // { dg-bogus "" } +};
parse4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref5.C =================================================================== --- ref5.C (nonexistent) +++ ref5.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } + +int i; +int &const j = i; // { dg-error "" } invalid const +int &const f(); // { dg-error "" } invalid const +void g () +{ + j = 1; + f() = 1; +}
ref5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template8.C =================================================================== --- template8.C (nonexistent) +++ template8.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// PRMS Id: 4827 + +class A; +template int f (const T&, const A *); + +int g (const int& a) +{ + return f (a, (A *)0); // { dg-bogus "" } failed unification +}
template8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: init.C =================================================================== --- init.C (nonexistent) +++ init.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Bug: g++ uses an empty initializer list for its own devious purpose +// internally, and gets confused if it shows up in the input. + +struct A { int i; }; + +A a = { };
init.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash12.C =================================================================== --- crash12.C (nonexistent) +++ crash12.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: g++ dies instead of flagging this invalid. + +inline float max(float x, float y) { return (x>y)?x:y; } + +float b(float x, float y, float z) +{ + float f = (y
crash12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf2.C =================================================================== --- pmf2.C (nonexistent) +++ pmf2.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// PRMS Id: 4484 (bug 3) +// Bug: g++ does implicitly take the address of methods passed to fns. + +struct A { + void f (); +}; + +void g (void (A::*)()); + +void h () { + g (A::f); // { dg-error "" } failed conversion to method pointer +}
pmf2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: net2.C =================================================================== --- net2.C (nonexistent) +++ net2.C (revision 338) @@ -0,0 +1,38 @@ +// { dg-do run } +// Test of various ?: problems. + +class D +{ +public: + void a(); + void b(); + D(int i):x(i) {} +private: + int x; +}; + +void D::a() {++x;} +void D::b() {--x;} + + +int aa=1, bb=0; + +int fa() {return 0;} +int fb() {return 2;} + +int main(int argc, char* argv[]) +{ + typedef int* pi; + int* p = (argc == 1)? &aa: &bb; + *p = 0; + + typedef int (*ifptr)(); + ifptr fp = (argc == 1)? fa: fb; + aa = fp(); + + D d(0); + typedef void (D::*dmem)(); + dmem mfp = (argc == 1)? &D::a: &D::b; + (d.*mfp)(); + return 0; +}
net2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmftemp.C =================================================================== --- pmftemp.C (nonexistent) +++ pmftemp.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 4484 (bug 1) +// Bug: g++ does not support templates involving method pointers. + +struct A { + void f (); +}; + +template void +f (void (T::*p)()) // { dg-bogus "" } use of template parm as aggregate +{ } + +void g () +{ + f (&A::f); // { dg-bogus "" } templates and method pointers +}
pmftemp.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const3.C =================================================================== --- const3.C (nonexistent) +++ const3.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do run } +// Bug: bar isn't emitted, which causes havoc. + +extern int i; +const int bar = i; +int i = 5; + +int main() +{ + return bar != 5; +}
const3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lex1.C =================================================================== --- lex1.C (nonexistent) +++ lex1.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do run } +int main() +{ + char c = '\351'; + if (c != '\351') + return 1; +}
lex1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion6.C =================================================================== --- conversion6.C (nonexistent) +++ conversion6.C (revision 338) @@ -0,0 +1,41 @@ +// { dg-do run } +// PRMS Id: g++/6034 + +extern "C" int printf (const char *, ...); + +class Base +{ + char x; +}; + +template +// remove the public Base inheritance and the problem goes away... +class Container : public Base +{ +public: + + Container(const T& aValue): myValue(aValue) { } + + operator const T&(void) const + { + printf("Container::const T& called\n"); + return myValue; + } + +protected: + + T myValue; +}; + +typedef unsigned short Type; + +typedef Container TypeContainer; + +int main(void) +{ + TypeContainer myTypeContainer(2); + Type t = myTypeContainer; + + printf ("myType = %d\n", t); + return t != 2; +}
conversion6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template10.C =================================================================== --- template10.C (nonexistent) +++ template10.C (revision 338) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// Bug: member operator shadows global template in tsubst. + +class ostream; + +template class smanip; + +template +ostream& operator<<(ostream& o, const smanip& m); + +template class smanip { +public: + friend ostream& operator<< <>(ostream &o, const smanip&m); +}; + +template +ostream& operator<<(ostream& o, const smanip& m) +{ return o;} + +class X +{ +public: + X operator<<(int); // commenting out this line makes it work! + void print(ostream& os); +}; + +void X::print(ostream& os) +{ + smanip smd; + os << smd; // { dg-bogus "" } +}
template10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload12.C =================================================================== --- overload12.C (nonexistent) +++ overload12.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do run } +// PRMS Id: 4066 +// Bug: g++ doesn't notice the const on reference returns. + +struct B { + int foo() { return 1; } + int foo() const { return 0; } +}; + +B b_; +const B &b () { return b_; } + +int main() +{ + return b().foo(); +}
overload12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg10.C =================================================================== --- rfg10.C (nonexistent) +++ rfg10.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: g++ doesn't notice the overflow in the enum values. + +#include + +enum COLOR +{ + red, + green = ULONG_MAX, + blue // { dg-error "overflow in enumeration" } +};
rfg10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: method.C =================================================================== --- method.C (nonexistent) +++ method.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: pointer to pointer is treated as plain pointer. +// PRMS Id: 1767 + +class Foo { +public: + void method(); +}; + +void func(Foo ** ppFoo) { + ppFoo->method(); // { dg-error "" } +}
method.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template35.C =================================================================== --- template35.C (nonexistent) +++ template35.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: instantiation of D() corrupts declaration of basis[]. + +struct B { }; +template +struct D : public B +{ + D() : B () { } +}; + +B const * basis[] = +{ + new D<0>, + new D<1>, +};
template35.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: g++ doesn't deal with friends also being derived classes. + +class A { + int i; + friend class B; +}; + +class B : public A { + void f () { i = 1; } +};
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: groff1.C =================================================================== --- groff1.C (nonexistent) +++ groff1.C (revision 338) @@ -0,0 +1,41 @@ +// { dg-do run } +// PRMS Id: 3744 +// Bug: unswitching a COND_EXPR initializer fails to set SIDE_EFFECTS on the +// result, so expand_expr ignores it. + +extern "C" { + int printf(const char *,...); + void exit(int); +} + +struct A { + int x; + int y; + + A() : x(0), y(0) { } +}; + +struct S { + S() : flags(0) { } + unsigned flags; + A from; + void foo(const A &pos); +}; + +void S::foo(const A &pos) +{ + A a = flags ? from : pos; + printf("%d %d\n", a.x, a.y); + if (a.x != 17 || a.y != 12) + exit (1); +} + +int main() +{ + A pos; + pos.x = 17; + pos.y = 12; + S s; + s.foo(pos); + return 0; +}
groff1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash5.C =================================================================== --- crash5.C (nonexistent) +++ crash5.C (revision 338) @@ -0,0 +1,4 @@ +// { dg-do assemble } +// Bug: g++ doesn't deal well with abstract declarators used inappropriately. + +void (*)(); // { dg-error "" }
crash5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: virtual.C =================================================================== --- virtual.C (nonexistent) +++ virtual.C (revision 338) @@ -0,0 +1,41 @@ +// { dg-do assemble } +// From: chw@bellcore.com (Charlie Woloszynski,MRE 2J-278,8295228,,27143) +// Newsgroups: gnu.g++.bug +// Subject: gcc-2.5.5 bug in multiple inheritance and pure virtual functions +// Date: 25 Jan 1994 23:41:36 -0500 + +// Bug: g++ fails to notice definitions of abstract virtuals. + +class A +{ +public: + virtual void a1() = 0; + virtual void a2() = 0; +}; + +class B +{ +public: + virtual void b1() = 0; + virtual void b2() = 0; +}; + + +class C: public A, public B +{ +public: + virtual void a2() {} + virtual void b2() {} +}; + +class D : public C +{ +public: + virtual void a1() {} + virtual void b1() {} +}; + +int main() +{ + D d; // { dg-bogus "" } +}
virtual.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg18.C =================================================================== --- rfg18.C (nonexistent) +++ rfg18.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Any expression may be explicitly converted to type void. + +struct S { int m[10]; } object; +struct S f () { return object; } + +void +test () +{ + (void) f().m; /* OK - cast to void; see constraints in 3.8.1 */ +}
rfg18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion11.C =================================================================== --- conversion11.C (nonexistent) +++ conversion11.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// PRMS Id: 8805 +// Bug: The two-level conversion is not found when calling a global fn. + +class Int { +public: + Int(int A); +}; + +class Ding { +public: + Ding(Int A); +}; + +class Something { +public: + void DoSomething(Ding A); // { dg-message "candidate is" } referred to +}; + +void DoSomething(Ding A); + +void foo(Something* pX) +{ + DoSomething(1); // { dg-error "conversion" } + pX->DoSomething(1); // { dg-error "no matching" } + (*pX).DoSomething(1); // { dg-error "no matching" } +}
conversion11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq3.C =================================================================== --- opeq3.C (nonexistent) +++ opeq3.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ generates code for assignment in invalid situations. + +class X { // { dg-error "assignment" } + int& a; +public: + X(int& i): a(i) { } +}; + +void foo () +{ + int one=1, two=2; + X a(one), b(two); + a = b; // { dg-message "synthesized" } +}
opeq3.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// { dg-options "-Wall" } + +enum tristate { no = -1, maybe, yes }; + +tristate +definite_tristate (int truth) +{ + return (truth) ? yes : no; +}
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: warning5.C =================================================================== --- warning5.C (nonexistent) +++ warning5.C (revision 338) @@ -0,0 +1,25 @@ +// { dg-do run } +// { dg-options "-Wall" } +// PRMS Id: 5135 +// Bug: g++ complains that the result of the new expression is not used. + +extern "C" int printf (const char *, ...); +inline void * operator new (__SIZE_TYPE__, void *p) { return p; } + +class foo { +public: + foo() : a(42) {}; + int a; +}; + +int +main() +{ + char buffer[1024]; + + new (buffer) foo; + + foo* pY = (foo *)buffer; + + return pY->a != 42; +}
warning5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth5.C =================================================================== --- synth5.C (nonexistent) +++ synth5.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do run } +// Bug: generated B::operator= tries to call A::operator= + +#pragma implementation +#line 1 "synth5.h" +#pragma interface + +struct A { + virtual A& operator= (const A&) = 0; +}; + +struct B: public A { +}; +#line 5 "synth5.C" +int main() { }
synth5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg2.C =================================================================== --- rfg2.C (nonexistent) +++ rfg2.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ complains about a class definition containing a const member +// but no constructor; it shouldn't complain at that point, since this is +// valid use. + +struct S { const int member; } object = { 0 };
rfg2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping10.C =================================================================== --- scoping10.C (nonexistent) +++ scoping10.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Test for scope-based hiding of functions. + +void f (char *); +struct A { + void f (); // { dg-message "candidate is" } referred to +}; +struct B : public A { + void g (char *); + void h () { + extern void g (); // { dg-message "" } + f("foo"); // { dg-error "" } hidden + g("foo"); // { dg-error "" } hidden + } +};
scoping10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tredecl3.C =================================================================== --- tredecl3.C (nonexistent) +++ tredecl3.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// PRMS Id: 4679 +// Bug: redeclaration of templates erases the definition. + +template class Foo { public: void h(); }; +template class Foo; + +void g() +{ + Foo f; +}
tredecl3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary3.C =================================================================== --- temporary3.C (nonexistent) +++ temporary3.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do run } +// Bug: the temporary returned from f is elided, causing a to be constructed +// twice but only destroyed once. + +extern "C" int printf (const char *, ...); + +int c,d; + +struct A { + A (int) { c++; } + ~A () { d++; } + A (const A&) { c++; } + int i; +}; + +A f () +{ return 1; } + +int main () +{ + { + A a (1); + a = f (); + } + printf ("%d %d\n", c, d); + return c != d; +}
temporary3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning10.C =================================================================== --- warning10.C (nonexistent) +++ warning10.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// { dg-options "-W -Wall" } +// Don't warn about these comparisons. + +struct A { + unsigned int b : 14; +}; + +int f (int i, unsigned char u, A a, unsigned long ul) +{ + if ((u & 0x10) == 0) + return 1; + if (i == 0U) + return 1; + if (a.b > ul) + return 1; + + return 0; +}
warning10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth10.C =================================================================== --- synth10.C (nonexistent) +++ synth10.C (revision 338) @@ -0,0 +1,52 @@ +// { dg-do assemble } +// { dg-options "-O" } +// Bug: Synthesizing methods for the nested class screwed up current_class_decl +// for the outer class. + +class A; +class AH +{ + public: + AH ( A * p = 0 ); + AH ( const AH & from ) + : pointer( from.pointer ) { inc(); } + ~ AH () { dec(); } + private: + A * pointer; + void inc() const; + void dec() const; +}; + +class A +{ + protected: + struct AttrTable + { + struct Row + { + }; + }; + + public: + + class Attributes + { + public: + class iterator + { + public: + iterator() : mo(0), attr(0) {} + iterator& operator++() { ++attr; return *this; } + iterator operator++(int) + { iterator tmp = *this; ++*this; return tmp; } + + private: + AH mo; + const AttrTable::Row* attr; + }; + + Attributes(AH mo) + : mo(mo) {} + AH mo; + }; +};
synth10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested4.C =================================================================== --- nested4.C (nonexistent) +++ nested4.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// From: quipu@ulrik.uio.no +// Subject: extern "C" nested class +// Date: Fri, 13 Aug 1993 15:33:53 +0200 + +extern "C" { + struct A { + struct B { int j; } *x; + }; +} + +void +foo () { + A a; + struct A::B *b; + b = a.x; // { dg-bogus "" } type `B' is not a base type for type `B' +}
nested4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access17.C =================================================================== --- access17.C (nonexistent) +++ access17.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// Make sure definitions of static members have the right access. + +struct A { +protected: + int i; // { dg-error "" } private + int f (); // { dg-error "" } +}; + +struct B: public A { + static int A::*p; + static int (A::*fp)(); +}; + +int A::* B::p = &A::i; // { dg-error "" } +int (A::* B::fp)() = &A::f; // { dg-error "" } + +struct C { + static int A::*p; + static int (A::*fp)(); +}; + +int A::* C::p = &A::i; // { dg-error "" } +int (A::* C::fp)() = &A::f; // { dg-error "" }
access17.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: thunk3.C =================================================================== --- thunk3.C (nonexistent) +++ thunk3.C (revision 338) @@ -0,0 +1,58 @@ +// { dg-do run { xfail rs6000-*-* powerpc-*-eabi v850-*-* sh-*-* sh64-*-* h8*-*-* xtensa*-*-* m32r*-*-* lm32-*-* } } +// Test that variadic function calls using thunks work right. +// Note that this will break on any target that uses the generic thunk +// support, because it doesn't support variadic functions. + + +#include + +struct A { + void* p; + A (void* q): p (q) { } + A (const A& a): p (a.p) { } +}; + +class CBase { +public: + virtual void BaseFunc(); +}; + +class MMixin { +public: + virtual A MixinFunc(int arg, ...) = 0; +}; + +class CExample : public CBase, public MMixin { +public: + A MixinFunc(int arg, ...); +}; + +void CBase::BaseFunc() +{ +} + +A CExample::MixinFunc(int arg, ...) +{ + va_list ap; + va_start (ap, arg); + + if (arg != 1 || va_arg (ap, int) != 2 || va_arg (ap, int) != 3 + || va_arg (ap, int) != 4 || va_arg (ap, int) != 5 + || va_arg (ap, int) != 6 || va_arg (ap, int) != 7 + || va_arg (ap, int) != 8 || va_arg (ap, int) != 9) + return 0; + return this; +} + +void* test(MMixin& anExample) +{ + return anExample.MixinFunc(1,2,3,4,5,6,7,8,9).p; +} + +int main () +{ + CExample c; + + if (test(c) != &c) + return 1; +}
thunk3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon3.C =================================================================== --- anon3.C (nonexistent) +++ anon3.C (revision 338) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// Bug: g++ dies. + +class cl { +public: + cl(); + void set(void *, char *, int); +private: + union { + float vf; + struct ff { // { dg-error "" } nested class in anonymous union + void *ptr; + char *name; + int sz; + } *vff; + }; +}; + +void cl::set(void *p, char *n, int sz) +{ + vff = new ff; // This procude an internal compiler error. + vff->ptr = p; + vff->name = n; + vff->sz = sz; +}
anon3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload21.C =================================================================== --- overload21.C (nonexistent) +++ overload21.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +struct X { + void f (int = 4, char = 'r'); // { dg-error "previous specification" } + void g (int = 4, char = 'r'); // { dg-error "previous specification" } +}; + +void +X::f (int i = 4, char x = 'r') // { dg-error "default argument" } +{ } + +void +X::g (int i = 9, char x = 's') // { dg-error "default argument" } +{ }
overload21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rvalue1.C =================================================================== --- rvalue1.C (nonexistent) +++ rvalue1.C (revision 338) @@ -0,0 +1,52 @@ +// { dg-do run } +// PRMS Id: 6000 +// Bug: g++ gets confused trying to build up a reference to a cast. + +class String { +protected: + char *cp; +public: + String(char *incp); + String(const String &constStringRef); + virtual void virtualFn1(void) const {;} +}; + +String::String(char *incp) +{ + cp = incp; +} + +String::String(const String &constStringRef) +{ +// Right here, do an 'info args', and look at the virtual function table +// pointer: typically junk! Calling the function through that table could +// do anything, since we're really leaping off into the void. This example +// goes down with 'SIGBUS', but I've seen 'SIGSEGV' too, and 'SIGILL' is +// possible. + + cp = constStringRef.cp; + constStringRef.virtualFn1(); +} + +void foofun(String string) +{ + ; +} + +class Class1 { +public: + Class1(const String & constStringRef); +}; + +Class1 :: Class1 (const String & constStringRef) +{ +// If instead of calling the function 'foofun()' here, we just assign +// 'constStringRef' to a local variable, then the vptr is typically == 0! + + foofun(String(constStringRef)); +} + +int main(void) +{ + Class1 *class1 = new Class1((char*) "Hi!"); +}
rvalue1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: destruct2.C =================================================================== --- destruct2.C (nonexistent) +++ destruct2.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 4342 +// Bug: g++ does not massage things enough to allow calling ~X(). + +struct X +{ + virtual ~X (); +}; + +struct Y : public X +{}; + +struct Z : public Y, public X +{}; // { dg-warning "" } + +void foo () +{ + Z* f = new Z; + delete f; // { dg-bogus "" } +}
destruct2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template44.C =================================================================== --- template44.C (nonexistent) +++ template44.C (revision 338) @@ -0,0 +1,62 @@ +// { dg-do run } +#include +#include + +template +class List { +public: + int len; + T *array; + + int length() const { return( len ); } + + List() : len( 0 ), array( 0 ) {} +}; + +template +int AlgoStdCompare(const T* a, const T* b) { + if (*a < *b) + return -1; + else + return (*a > *b); // 0 if equal, 1 if greater +} + +int AlgoStdCompare(const char* const* a, const char * const*b) +{ + return strcmp(*a,*b); +} + +template +void AlgoFixupSort(List< T >* , int, int ) { +} + +template +void AlgoSort(int (*compare)(const T *, const T *), + void (*fixup)( List *, int first, int last), + List< T >* theList, int first, int last) { + if (last < 0) + last = theList->length()-1; + + qsort(theList->array+first, last-first+1, sizeof(T), + (int (*)(const void *, const void *))compare); + if (fixup) + fixup(theList, first, last); +} + +template +void AlgoSort(List< T >* theList, int first = 0, int last = -1) { + int (*compare)(const T*, const T*) = AlgoStdCompare; + void (*fixup)( List *, int first, int last) = AlgoFixupSort; + + AlgoSort(compare, fixup, theList, first, last); +} + +int +main() +{ + List slist; + AlgoSort( &slist ); + + List ilist; + AlgoSort( &ilist ); +}
template44.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template27.C =================================================================== --- template27.C (nonexistent) +++ template27.C (revision 338) @@ -0,0 +1,49 @@ +// { dg-do run } +// PRMS Id: 6826 +// Check that unnecessary templates are not instantiated. + +template +class Test +{ + public: + void doThiss(); + void doThat(); +}; + +template +void Test::doThiss() +{ + T x; + + x.thiss(); +} + +template +void Test::doThat() +{ + T x; + + x.that(); +} + +class A +{ + public: + void thiss() {} +}; + +class B +{ + public: + void that() {} +}; + +int main() +{ + Test a; + a.doThiss(); // a.doThat() is not well formed, but then + // it's not used so needn't be instantiated. + + Test b; + b.doThat(); // simillarly b.doThiss(); +}
template27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping4.C =================================================================== --- scoping4.C (nonexistent) +++ scoping4.C (revision 338) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// PRMS Id: 4375 +// Bug: g++ fails to keep track of nested typedefs properly. + +class A { +public: + typedef const char * Ptr; + Ptr s; + Ptr get_string(); + A(Ptr string); // { s = string; }; +}; + +class B { +public: + typedef A * Ptr; + Ptr a; + Ptr get_A(); + B(Ptr a_ptr); +}; + +A::A(Ptr string) { // { dg-bogus "" } + s = string; // { dg-bogus "" } +} + +int main() { + A a("testing"); + A *a_ptr; + B b(&a); + a_ptr = b.get_A(); +}
scoping4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: aggregate.C =================================================================== --- aggregate.C (nonexistent) +++ aggregate.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do run } +struct A { int i; }; + +int main() +{ + A a1 = { 42 }; + A a2 (a1); + A a3 = { 137 }; + a1 = a3; + + if (a1.i == 137 && a2.i == 42 && a3.i == 137) + return 0; + return 1; +}
aggregate.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const.C =================================================================== --- const.C (nonexistent) +++ const.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do run } +// Bug: a ends up in the text segment, so trying to initialize it causes +// a seg fault. + +struct A { + int i; + A(): i(0) {} + A(int j): i(j) {} +}; + +const A a; +const A b(1); + +int main () +{ + return 0; +}
const.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload29.C =================================================================== --- overload29.C (nonexistent) +++ overload29.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Bug: we get an error trying to build up our ideal candidate. + +class C { + public: + C( const char * ); +}; + + extern const char c1[]; + +void f2( const char * ); + +void f1() { + C *fntp = new C(c1); // Line 10 + f2( c1 ); +}
overload29.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg27.C =================================================================== --- rfg27.C (nonexistent) +++ rfg27.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// Don't compile this one with -Wno-long-long... + +short volatile short var_0_2; /* { dg-error "" } duplicate short */ +long volatile long var_0_3; /* { dg-error "" } duplicate long */ +signed volatile signed var_0_7; /* { dg-error "" } duplicate signed */ +unsigned volatile unsigned var_0_8; /* { dg-error "" } duplicate unsigned */
rfg27.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operator.C =================================================================== --- operator.C (nonexistent) +++ operator.C (revision 338) @@ -0,0 +1,32 @@ +// { dg-do assemble } +// { dg-options "" } +// General test for operator overloading permissiveness. + +typedef __SIZE_TYPE__ size_t; + +struct A { + int operator?:(int a, int b); // { dg-error "expected type-specifier" } + static int operator()(int a); // { dg-error "must be a nonstatic member" } + static int operator+(A,A); // { dg-error "either a non-static member" } + int operator+(int a, int b = 1); // { dg-error "either zero or one" } + int operator++(char); // { dg-error "must take 'int'" } + void operator delete (void *); + void operator delete (void *, unsigned long); +}; + +struct B { + void * operator new (size_t, void *); + int operator++(int = 0); + int operator+ (int); + void operator()(); + char * operator[](int); + B * operator->(); +}; + +int operator-(int a, int b); // { dg-error "argument of class or" } + +void * operator new (A a); // { dg-error "first parameter" } +void operator delete (A a); // { dg-error "first parameter" } + +char * operator char * (int); // { dg-error "return type" "ret" } +// { dg-error "nonstatic member function" "mem" { target *-*-* } 31 }
operator.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 4688 +// Bug: g++ can't deal with templates instantiated within extern "C". + +class Gnaf { +public: + virtual int invariant (); +}; + +template class Array : public Gnaf { +public: + virtual int invariant(); +}; + +extern "C" +int foo() +{ + Array toConv; + return 0; +}
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: dtor5.C =================================================================== --- dtor5.C (nonexistent) +++ dtor5.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do run } +// PRMS Id: 5286 +// Bug: g++ forgets side-effects of object in call to nonexistent destructor. + +#include + +int r; + +template struct A { + T *p; + int i; + A() { i = 0; p = (T*) new char[sizeof (T)]; new (p + i++) T; } + ~A() { p[--i].~T(); r = i; } +}; + +int main() +{ + { A a; } + + int* p = (int*) new char[sizeof (int)]; + new (p + r++) int; + typedef int I; + p[--r].~I(); + + return r; +}
dtor5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload3.C =================================================================== --- overload3.C (nonexistent) +++ overload3.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: bar is considered to be overloaded (i.e. its +// IDENTIFIER_GLOBAL_VALUES are TREE_LISTs) even though it isn't, +// so default_conversion thinks it can't resolve the name. + +void foo (); +void bar (); + +void baz () +{ + void (*p)() = 1 ? (void (*)()) &foo : bar; +}
overload3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse5.C =================================================================== --- parse5.C (nonexistent) +++ parse5.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: foo (bar) should be a declaration of a static data member, not a +// function; it's getting caught by the rules for constructors. + +typedef int foo; +typedef int bar; +struct A { + static foo (bar); // { dg-bogus "" } +}; + +int i = A::bar; // { dg-bogus "" } +int (*fp)(bar) = A::foo; // { dg-error "" }
parse5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref6.C =================================================================== --- ref6.C (nonexistent) +++ ref6.C (revision 338) @@ -0,0 +1,3 @@ +// { dg-do assemble } +const int &f(); +int &a = f(); // { dg-error "" }
ref6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template9.C =================================================================== --- template9.C (nonexistent) +++ template9.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 4864 +// Bug: g++ can't deal with a guiding declaration which comes before the +// template. + +void f (const int&, const int&); +template void f (const T&, const T&) { } + +void g (int a) +{ + f (a,a); // { dg-bogus "" } two identical candidates +}
template9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum.C =================================================================== --- enum.C (nonexistent) +++ enum.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// PRMS Id: 4337 +// Bug: Enums are not looked up to arbitrary depth. + +struct W { + enum A { B }; +}; + +struct X : public W +{}; + +struct Y : public X +{}; + +struct S +{ + X::A a1; + Y::A a2; // { dg-bogus "" } +};
enum.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf3.C =================================================================== --- pmf3.C (nonexistent) +++ pmf3.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// From: enewton@uunet.uu.NET +// Subject: g++ 2.5.8: cannot cast member function pointers +// Date: 27 Jan 1994 01:22:56 -0500 + +struct A { + void f(char); + void g(int); +}; + +typedef void (A::*Ptr)(char); + +void q() { + Ptr p; + + p = (Ptr) &A::f; + p = (Ptr) &A::g; + p = &A::f; +}
pmf3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: const4.C =================================================================== --- const4.C (nonexistent) +++ const4.C (revision 338) @@ -0,0 +1,25 @@ +// { dg-do assemble } +// PRMS Id: 8927 +// Bug: complex inheritance interferes with const checking + +class GrandParent { +public: + virtual void DoIt(); +protected: + int A; +}; + +class Parent : virtual public GrandParent { +public: + virtual void DoX() const; +}; + +class Child : public Parent { +public: + void DoX() const; +}; + +void Child::DoX() const +{ + A = 10; // { dg-error "" } assignment to const +}
const4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion7.C =================================================================== --- conversion7.C (nonexistent) +++ conversion7.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do run } +// Bug: g++ tries to look inside (B*)0 for a virtual base pointer. + +struct A +{ +}; + +struct B : virtual A +{ +}; + +A* a; + +int main() +{ + a = (B*)0; +}
conversion7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template11.C =================================================================== --- template11.C (nonexistent) +++ template11.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do run } +// Bug: initializers for static data members of templates don't get run. + +template struct A { + static T t; +}; + +int foo () { return 1; } + +template <> +int A::t = foo (); + +int main () +{ + return (A::t != 1); +}
template11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload30.C =================================================================== --- overload30.C (nonexistent) +++ overload30.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// PRMS Id: 6412 + +class Foo; + +template +class Temp +{ + F func_; +public: + Temp (F f) : func_(f) {} +}; + +template +T* func1 (T* t) { return t; } + +Temp temp2(func1);
overload30.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempsub.C =================================================================== --- tempsub.C (nonexistent) +++ tempsub.C (revision 338) @@ -0,0 +1,28 @@ +// { dg-do assemble } +// Distillation of crash1.C problem (PR 3633) + +template +class A +{ + P p; +}; + +template +class B +{ + A a; // bogus error - temp parm name propagating +}; + +template +class C +{ + B b; +}; + +template +class D +{ + S s; +}; + +C< D > c;
tempsub.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload13.C =================================================================== --- overload13.C (nonexistent) +++ overload13.C (revision 338) @@ -0,0 +1,28 @@ +// { dg-do run } +// Bug: g++ screws up derived->base conversions when calling a global function +// in the presence of matching members in the base. Whew. + +struct xios { + virtual ~xios() { } +}; + +struct xistream: virtual public xios { + int j; + void operator>>(char&); +}; + +struct xfstreambase: virtual public xios { }; + +struct xifstream: public xfstreambase, public xistream { }; + +void operator>>(xistream& i, int j) +{ + i.j = 0; +} + +int main() { + int i; + xifstream ifs; + + ifs >> i; +}
overload13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg11.C =================================================================== --- rfg11.C (nonexistent) +++ rfg11.C (revision 338) @@ -0,0 +1,2 @@ +// { dg-do assemble } +typedef int int; /* { dg-error "" } trying to redefine int */
rfg11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: incomplete1.C =================================================================== --- incomplete1.C (nonexistent) +++ incomplete1.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// The reference parameter to fred isn't dereferenced properly. + +class Gump {}; +Gump operator & (const Gump x){return x;} + +class B; + +void *sam(int &x) +{return &x;} + +const void *fred(const B& x) +{return &x;} // "&x" causes the compilation error. + +class B {};
incomplete1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: optimize2.C =================================================================== --- optimize2.C (nonexistent) +++ optimize2.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do run } +// { dg-options "-w" } +// Used to crash on the alpha with optimization. + +extern "C" void abort (void); + +struct Fix { + unsigned short l; +}; + +static inline void f (int len) +{ + if (len > 65535) + abort (); +} + +struct Fix a = { 33 }; + +main() +{ + f (a.l); +}
optimize2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template36.C =================================================================== --- template36.C (nonexistent) +++ template36.C (revision 338) @@ -0,0 +1,57 @@ +// { dg-do run } +// Testcase for implicit 'typename' and resolution of 'typename's in the +// current scope. + +class base1 { +public: + int bar() const + { return 1; } +}; + +class base2 { +public: + int bar() const + { return 0; } +}; + +template +struct base_trait { + typedef base1 base; +}; + +template<> +struct base_trait { + typedef base2 base; +}; + +template +class weird : public base_trait::base { +public: + typedef typename base_trait::base base; + + base f (); + int base::* g (); + + int zowee() const + { return this->bar(); } +}; + +template +typename weird::base weird::f () +{ + return base(); +} + +// The standard does not allow this case; the `typename' keyword may +// not appear in a ptr-operator. +#if 0 +template +int typename weird::base::* weird::g () +{ return 0; } +#endif + +int main() +{ + weird z; + return z.zowee() || z.f().bar(); +}
template36.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Simple testcase for access control. + +class A { + protected: + void f (); +}; + +class B : public A { + public: + void f () { A::f(); } +};
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: template19.C =================================================================== --- template19.C (nonexistent) +++ template19.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do run } +// Make sure type deduction isn't confused by top-level cv-quals. +template T max (const T a, const T b) { return a>b?a:b; } + +int main() +{ + int a = 0, b = 1; + int c = max (a, b); + int d = max ((const int)a, (const int)b); +}
template19.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash6.C =================================================================== --- crash6.C (nonexistent) +++ crash6.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// Bug: g++ dies on the below. + +class A { }; +void f () +{ + A a; + a.~a(); // { dg-error "" } causes segfault +}
crash6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq4.C =================================================================== --- opeq4.C (nonexistent) +++ opeq4.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// PRMS Id: 4329 +// Bug: default op= gives an warning about casting away volatile. + +struct foo +{ + volatile int bar[2]; +};
opeq4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum5.C =================================================================== --- enum5.C (nonexistent) +++ enum5.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do run } +enum { a = 1 }; + +int main(void) +{ + int l = -1; + + return ! (l < a); // testcase fails if a is unsigned +}
enum5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning6.C =================================================================== --- warning6.C (nonexistent) +++ warning6.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-Wunused" } + +struct A { + int i:8; + virtual ~A() {} +};
warning6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth6.C =================================================================== --- synth6.C (nonexistent) +++ synth6.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ tries to generate an op= for DbmItem and fails. + +class RefCount{ +public: + RefCount(); + +private: + RefCount& operator=(const RefCount); +}; + +class DbmItem: public RefCount{ +public: + DbmItem(): RefCount() {} +};
synth6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool.C =================================================================== --- bool.C (nonexistent) +++ bool.C (revision 338) @@ -0,0 +1,46 @@ +// { dg-do assemble } +// Testcase for uses of bool. + +int i,j,k; + +/* Check that types of certain expressions are bool. */ +void f () +{ + i ? j == k : true; + i ? j < k : true; + i ? j && k : true; +} + +/* Check that g++ can find a conversion to bool when one exists. */ +struct A { operator char * (); } a; +struct B { operator int (); } b; +struct C { operator float (); } c; +struct D { operator bool (); } d; +struct E { operator int E::* (); } e; + +void g () +{ + a || true; + b || true; + c || true; // { dg-bogus "" } + d || true; + e || true; +} + +/* Check for support in templates. */ +template struct F { }; +template class F; + +template void f (T, bool) { } +template void f (bool, bool); + +/* Special cases. */ +void h () +{ + /* Used to cause infinite recursion. */ + i&1 || true; + /* Should find conversion path to int. */ + d == true; +} + +bool boo = -1;
bool.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lookup2.C =================================================================== --- lookup2.C (nonexistent) +++ lookup2.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } + +struct A { + struct B { + B (); + }; +}; +void f (A::B); +void g () +{ + A::B b; + f (b); // { dg-bogus "" } can't find nested constructor +}
lookup2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: precedence.C =================================================================== --- precedence.C (nonexistent) +++ precedence.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// Bug: g++ groups ->* before casts. +// PRMS Id: 4484 (bug 4) + +struct A { }; +struct B : public A { void f (); }; + +void g () +{ + A* ap = new B; + void (B::*p)() = &B::f; + + ((B*)ap->*p)(); // { dg-bogus "" } incorrect precedence +}
precedence.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg3.C =================================================================== --- rfg3.C (nonexistent) +++ rfg3.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ remembers the members of OUTER and complains about the second +// definition. + +void +test () +{ + { + struct OUTER { struct INNER { int mbr; } member; }; + } + + { + struct OUTER { struct INNER { int mbr; } member; }; + } +}
rfg3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempover.C =================================================================== --- tempover.C (nonexistent) +++ tempover.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// GROUPS passed templates overloading +#define TEMPL template + +class B {}; + +TEMPL class A : virtual public B { + public: + A(int); +}; + +TEMPL A::A(int){} + +A a(1);
tempover.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access10.C =================================================================== --- access10.C (nonexistent) +++ access10.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// PRMS Id: 4839 +// Bug: The initializer of a static member of a class has the same acess +// rights as a member function. g++ doesn't realize that. + +class X +{ + X (int); + static X foo; +public: + void dummy(); +}; + +X X::foo = 9;
access10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping11.C =================================================================== --- scoping11.C (nonexistent) +++ scoping11.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } + +void f (); +void g () +{ + int f; + { + void f (); + f (); // { dg-bogus "" } trying to call integer + } +}
scoping11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary4.C =================================================================== --- temporary4.C (nonexistent) +++ temporary4.C (revision 338) @@ -0,0 +1,32 @@ +// { dg-do run } +// Bug: g++ initializes both B::i and B::j before destroying any temps. + +extern "C" int printf (const char *, ...); + +int c = 0; +int d = 0; +int r = 0; + +struct A { + A() { if (c != d) r = 1; ++c; } + A(const A&); // declare so g++ returns A on the stack + ~A() { ++d; } + operator int () { return 0; } +}; + +A foo () +{ + return A(); +} + +struct B { + int i; + int j; + B(): i(foo()), j(foo()) { } +}; + +int main() +{ + B b; + return r; +}
temporary4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tredecl4.C =================================================================== --- tredecl4.C (nonexistent) +++ tredecl4.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// It is illegal to use the name of a class template for anything else, +// including another class template. + +template class A { }; // { dg-message "previous" } +template class A { }; // { dg-error "redeclared" }
tredecl4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested5.C =================================================================== --- nested5.C (nonexistent) +++ nested5.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } + +struct A { + struct B { }; +}; + +struct C : public A { + struct D + : public B // { dg-bogus "" } can't find B + { }; +};
nested5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: member.C =================================================================== --- member.C (nonexistent) +++ member.C (revision 338) @@ -0,0 +1,35 @@ +// { dg-do assemble } +// GROUPS passed member-pointers error-reporting +struct Y +{ + struct X + { + int A; + int Y::X::* foo () { undef1(1); return &Y::X::A; }// { dg-error "" } foo().* + int bar () { return A; } + }; +}; + +int Y::X::* foo () +{ + undef2(1);// { dg-error "" } foo().* + return &Y::X::A; +} + +int Y::X::* (* foo2 ())() +{ + undef3(1);// { dg-error "" } foo().* + return foo; +} + +int (Y::X::* bar2 ()) () +{ + undef4(1);// { dg-error "" } foo\(\).* + return Y::X::bar;// { dg-error "" } foo\(\).* +} + +int Y::X::* (Y::X::* foo3 ())() +{ + undef5(1);// { dg-error "" } foo().* + return Y::X::foo;// { dg-error "" } foo().* +}
member.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lookup.C =================================================================== --- lookup.C (nonexistent) +++ lookup.C (revision 338) @@ -0,0 +1,30 @@ +// { dg-do assemble } +// PRMS Id: 4357 +// Bug: g++ forgets to clear out push/popclass cache stuff when instantiating +// templates. + +template class ccHandle { }; + +class cc_GStack +{ + static cc_GStack* freeList; +}; + +// OK if ccGStack is not derived from ccHandle +class ccGStack : public ccHandle { }; + +struct S { }; + +S* freeList; + +class X +{ +public: + void foo(); +}; + +void X::foo() +{ + S m; + freeList = &m; +}
lookup.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lvalue2.C =================================================================== --- lvalue2.C (nonexistent) +++ lvalue2.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// PRMS Id: 4892 +// Bug: COND_EXPRs, MODIFY_EXPRs and COMPOUND_EXPRs aren't properly recognized +// as lvalues. + +extern int foo; +int& f (int& a, int& b) +{ + return (foo ? a : b); // { dg-bogus "" } +} + +int& g (int& a) +{ + return (a = 0); // { dg-bogus "" } +} + +int& h (int& a, int& b) +{ + return (a = 1, b); // { dg-bogus "" } +}
lvalue2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access18.C =================================================================== --- access18.C (nonexistent) +++ access18.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// { dg-options "-w" } +// PRMS Id: 5073 +// Bug: g++ doesn't catch access violations in base initializers. + +int r = 0; +class A { + private: + A() { r = 1; } // { dg-error "" } + ~A() {} // { dg-error "" } +}; + +class B : public A { + public: + B(): A() {} // { dg-error "" } + B(const B&) {} // { dg-error "" } + ~B() { } // { dg-error "" } private dtor +}; + +main() +{ + B b; + return r; +}
access18.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: trivial.C =================================================================== --- trivial.C (nonexistent) +++ trivial.C (revision 338) @@ -0,0 +1,71 @@ +// { dg-do assemble } +// PRMS Id: 3665 + +//------------------------------------------------------------- +// Referential declaration within class +// +// Imbeded below is the invocation of the compiler and the error +// message +// +// This compiles successfully with both the xlC and CFRONT compilers +// This was reviewed with Clem Dickey and we agree that it appears to +// be a Cygnus compiler problem. +//------------------------------------------------------------- +/* +$ make bug.reference.o + /usr/p3/bin/i960-vxworks-g++ `getsrc bug.reference.C` -I. -Iinc1 -Iinc2 + -I/vw5.0.3/h -I/vw5.0.3/h/i960 -I/usr/p3/lib/gcc-lib/i960-vxworks/cygnus-2.3.3 +/include -I/usr/p3/lib/gcc-lib/i960-vxworks/cygnus-2.3.3-930417/include -I/usr/p +3/lib/i960-vxworks/include -I/usr/p3/i960-vxworks/include -c -DCPU_FAMILY=I960 +-DCPU=I960CA -mca -mold-align -g3 -O1 -DASSERT_ON -nostdinc -nostdinc++ -MD +./bug.reference.C: In method `class1::class1 (long unsigned int, long unsigned i +nt **&)': +./bug.reference.C:43: cannot convert type `long unsigned int **' +./bug.reference.C:43: to type `long unsigned int *[]&' +make: 1254-004 The error code from the last command is 1. +*/ + +// typedefs +typedef unsigned long u32; +typedef u32 *ul[16]; + +// class defs +class class1 { + u32 var1; + class1(const class1 &); // Copy constructor + class1& operator=(const class1 &); // operator= member function +public: + class1(u32, ul&); + ul &ulref; + ~class1() {} +}; + + +// member function defs +class1::class1(u32 u, ul &l) : var1(u), ulref(l) +{} + +/* =========================================================================== +Note: The following is a "work around" that allows the successful compilation. + + +// typedefs +typedef unsigned long u32; +typedef u32 *ul[16]; + +// class defs +class class1 { + u32 var1; + class1(const class1 &); // Copy constructor + class1& operator=(const class1 &); // operator= member function +public: + class1(u32, ul*); + ul &ulref; + ~class1() {} +}; + + +// member function defs +class1::class1(u32 u, ul *l) : var1(u), ulref(*l) +{} +============================================================================*/
trivial.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: operator2.C =================================================================== --- operator2.C (nonexistent) +++ operator2.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// PRMS Id: 6018 + +class string { + char *p; +public: + string(const char* s) ;// { p == s; } + operator const char*() ;// { return s; } +}; + +void f4(string& s) +{ + *s; // implies "s.operator const char*()" +}
operator2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template20.C =================================================================== --- template20.C (nonexistent) +++ template20.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do run } +// Make sure type deduction works for both types of array parameters. +template void f (T (&a)[2]) { } +template void g (T a[2]) { } +int main() +{ + int a[2] = { 0, 0 }; + f (a); + g (a); +}
template20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload22.C =================================================================== --- overload22.C (nonexistent) +++ overload22.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// PRMS Id: 4574 +// Bug: g++ prefers int to double for float& argument + +inline double abs (double x) { return x;} +inline int abs (int i) { return i; } + +float& fn(float& f) +{ + return f; +} + +void foo() +{ + float f = 23.45; + abs(fn(f)); // gets bogus warning +}
overload22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: anon4.C =================================================================== --- anon4.C (nonexistent) +++ anon4.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "-O" } +// PRMS Id: 5371 +// Bug: g++ screws up the alignment of buff and dies. + +main() +{ + union { + double a; + char buff[sizeof(double)]; + }; + + void *p = buff; +}
anon4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: destruct3.C =================================================================== --- destruct3.C (nonexistent) +++ destruct3.C (revision 338) @@ -0,0 +1,45 @@ +// { dg-do assemble } +// { dg-options "-w" } +// PRMS Id: 4342 (second testcase) +// Bug: g++ still can't deal with ambiguous inheritance in destructor calls. + +struct ccUnwind +{ + ccUnwind (); + virtual ~ccUnwind (); +}; + +struct ccPersistent +{ + virtual void bar(); +}; + +struct ccImpExp : public ccPersistent, public ccUnwind +{}; + +struct ccTool : public ccImpExp +{}; + +struct ccScreenTool : public ccTool +{}; + +struct ccVTool : public ccScreenTool +{}; + +struct ccScreenObjRep : public ccUnwind +{}; + +struct ccScreenObj : public ccScreenObjRep +{}; + +struct ccVSTool : public ccImpExp, public ccUnwind +{}; + +struct ccSCCP : public ccVSTool +{}; + +void foo () +{ + ccSCCP* foo = new ccSCCP; + delete foo; +}
destruct3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg20.C =================================================================== --- rfg20.C (nonexistent) +++ rfg20.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } + +typedef void func_type (); +func_type *fp; +void *vp; + +void example () +{ + vp != fp; // { dg-error "forbids comparison" } no conversion from pfn to void* +}
rfg20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rvalue2.C =================================================================== --- rvalue2.C (nonexistent) +++ rvalue2.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do run } +// Test for undesired aliasing. + +struct A { + const A * get_this () const { return this; } +}; + +int main () +{ + A a; + int r = 0; + const A& ar1 = (A)a; + if (&ar1 == &a) + r |= 1; + if (A(a).get_this () == &a) + r |= 2; + return r; +}
rvalue2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template28.C =================================================================== --- template28.C (nonexistent) +++ template28.C (revision 338) @@ -0,0 +1,34 @@ +// { dg-do run } +// PRMS Id: 7179 + +template +class Car{ +public: + Car(); +} ; + +class Wheels{ +public: + Wheels(); +} ; + +class Shop +{ +public: + Shop(); +private: + Car car ; +} ; + +Wheels::Wheels() {} + +Shop::Shop() {} + +int main() +{ + Shop shop ; + return 0 ; +} + +template +Car::Car() {}
template28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: net.C =================================================================== --- net.C (nonexistent) +++ net.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: g++ doesn't instantiate function templates in instantiate_type. + +template void fn (T t) { } +template struct A { + void (*p)(T); + A() { p = fn; } +}; + +A a;
net.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping5.C =================================================================== --- scoping5.C (nonexistent) +++ scoping5.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ thinks that A defines operator delete, and tries to call it. + +struct A { + ~A () { ::operator delete (0); } +};
scoping5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctor1.C =================================================================== --- ctor1.C (nonexistent) +++ ctor1.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do run } +// PRMS Id: 5584 + +extern "C" +{ + struct xx { + void (*xx)(void); + int x,y; + }; +} + +int r = 1; + +void f(void) +{ + r = 0; +} + +int main() +{ + struct xx p; + + p.xx = f; + p.xx(); + + return r; +}
ctor1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg28.C =================================================================== --- rfg28.C (nonexistent) +++ rfg28.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +/* From 01/25/94 working paper (7.1.3): + + If, in a decl-specifier-seq containing the decl-specifier typedef, + there is no type-specifier, or the only type-specifiers are cv- + qualifiers, the typedef declaration is ill-formed. +*/ + +typedef foo; // { dg-error "" } invalid typedef +typedef const bar; // { dg-error "" } invalid typedef
rfg28.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template2.C =================================================================== --- template2.C (nonexistent) +++ template2.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: instantiation of member templates breaks. + +template struct A { + static void f (); + void g (); +}; + +template void A::f () { } +template void A::g () { } + +A a;
template2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload4.C =================================================================== --- overload4.C (nonexistent) +++ overload4.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Testcase for simple overloading resolution. + +void foo (int); +void foo (int, int); + +void bar () +{ + foo (1); + foo (1, 2); +}
overload4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typeck.C =================================================================== --- typeck.C (nonexistent) +++ typeck.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// Bug: g++ fails to catch incompatibilities in the parameter lists when +// assigning. + +typedef struct S *type_p; +typedef struct S const *ctype_p; + +typedef ctype_p (*PF) (int); + +type_p callee (type_p arg) { return 0; } + +void foobar () +{ + static PF p = callee; // { dg-error "" } + + p = callee; // { dg-error "" } +} + +PF pp = callee; // { dg-error "" }
typeck.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse6.C =================================================================== --- parse6.C (nonexistent) +++ parse6.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// PRMS id: 4653 +// Bug: g++ tries to resolve declarator/expression ambiguities too soon. + +template struct A { }; + +void f () { + void (A::*pmf) (); // { dg-bogus "" } late binding +}
parse6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref7.C =================================================================== --- ref7.C (nonexistent) +++ ref7.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do run } +// Testcase for the lifetime of a temporary object which is used to +// initialize a reference. + +int destroyed = 0; + +struct A { + A() { } + A(int) { } + ~A() { destroyed++; } +}; + +A a; +A foo () { return a; } + +int main() +{ + const A& ar = foo(); + const A& ar2 = A(); + const A& ar3 = (A)1; + return destroyed; +}
ref7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq.C =================================================================== --- opeq.C (nonexistent) +++ opeq.C (revision 338) @@ -0,0 +1,40 @@ +// { dg-do run } +// PRMS Id: 4297 (related to 3525) +// Bug: Generating default op= didn't set TYPE_HAS_ASSIGNMENT, so it wasn't +// found. + +extern "C" int printf (const char *, ...); + +class Y +{ +public: + Y(const char*) {} + Y& operator = (const Y&) { return *this; } +}; + + +class X +{ +public: + X(int v, const char* m) : _v(v), _m (m) {} + X () : _v(0), _m("Unknown") {} + // Defining our own op= here makes things work correctly. + +private: + int _v; + int _m4; + // Adding more members here increases the count on u. + Y _m; +}; + +const X sPassed (1, "Passed"), sFailed (-1, "Failed"); + +int main (int, char**) +{ + X result; + int u = 0; + result = (u++ ? sPassed : sFailed); + if (u == 1) + return 0; + return 1; +}
opeq.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf4.C =================================================================== --- pmf4.C (nonexistent) +++ pmf4.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// PRMS Id: 4484 (bug 5) +// Bug: g++ can't convert between pmf types. + +class A; +typedef void (A::*pmf)(); +typedef void (A::*pmfc)() const; + +pmfc p = (pmfc)(pmf)0; // { dg-bogus "" } pmf conversion
pmf4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: binding.C =================================================================== --- binding.C (nonexistent) +++ binding.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ only looks in the current temporary binding level for a name. + +struct T { ~T(); }; + +int main() +{ + foo: + T t; // { dg-error "" } redeclared + bar: + T t; // { dg-error "" } redeclaration +}
binding.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool2.C =================================================================== --- bool2.C (nonexistent) +++ bool2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do run } +// Make sure that bool bitfields promote to int properly. + +struct F { + bool b1 : 1; + bool b2 : 7; +}; + +int main() +{ + F f = { true, true }; + + if (int (f.b1) != 1) + return 1; +}
bool2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion8.C =================================================================== --- conversion8.C (nonexistent) +++ conversion8.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do run } +// PRMS id: 8279 + +int main () +{ + char *const *p = 0; + char **q = 0; + + (void)(p - q); + (void)(q - p); +}
conversion8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template12.C =================================================================== --- template12.C (nonexistent) +++ template12.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// Testcase for 'this is a type' syntax. + +struct B { + typedef int A; +}; + +template struct Y { + void f() { + typename T::A *d; + } +}; + +template class Y;
template12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload31.C =================================================================== --- overload31.C (nonexistent) +++ overload31.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// PRMS Id: 6568 +// Bug: g++ complains about the ambiguous conversion to bool even though +// we wouldn't end up using it anyway. + +class AString +{ +public: + AString (unsigned len); + operator char *() const; + operator char const *() const; +}; + +void +foo(unsigned t, AString const & handle) +{ +} + +void +foo(AString const & handle, bool includeSpecials) +{ + unsigned t; + foo(t, handle); +}
overload31.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload14.C =================================================================== --- overload14.C (nonexistent) +++ overload14.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: g++ fails to recognize that the template matches the target type. + +template void foo (T *, int); + +struct A; +void bar () +{ + void (*p)(A *, int) = &foo; +}
overload14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: incomplete2.C =================================================================== --- incomplete2.C (nonexistent) +++ incomplete2.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } + +struct A { + int foo(A a) { return a.bar(); } + int bar(); + int n; +};
incomplete2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg12.C =================================================================== --- rfg12.C (nonexistent) +++ rfg12.C (revision 338) @@ -0,0 +1,2 @@ +// { dg-do assemble } +int array[3] = { 1, 2, 3, 4 }; /* { dg-error "" } excess initializer elements */
rfg12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempargs.C =================================================================== --- tempargs.C (nonexistent) +++ tempargs.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// GROUPS passed templates overloading +template class Vector { }; +template struct Sort { static void sort (Vector &); }; +template void Sort::sort (Vector &) { } +struct whee { typedef int foo; }; + +void f (Vector &vi) { Sort::sort (vi); }
tempargs.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cond.C =================================================================== --- cond.C (nonexistent) +++ cond.C (revision 338) @@ -0,0 +1,58 @@ +// { dg-do assemble } +// GROUPS passed rtti +// Negative testcase for decls in conditions. + +int main() +{ + float i; + + if (int i = 1) // { dg-error "" "" { xfail *-*-* } } , + { + char i; // { dg-error "" "" { xfail *-*-* } } , + char j; + } + else + { + short i; // { dg-error "" "" { xfail *-*-* } } , + char j; + } + + while (int i = 0) // { dg-error "previously" } + { + int i; // { dg-error "redeclaration" } + } + + for (; int i = 0; ) // { dg-error "previously" } + { + int i; // { dg-error "redeclaration" } + } + + switch (int i = 0) // { dg-error "" "" { xfail *-*-* } } + { + default: + int i; // { dg-error "" "" { xfail *-*-* } } + } + + if (struct A { operator int () { return 1; } } *foo = new A) // { dg-error "defined" } + ; + + A bar; // { dg-error "not declared" "decl" } + // { dg-error "expected" "exp" { target *-*-* } 39 } + + if (enum A { one, two, three } foo = one) // { dg-error "defined" "def" } + // { dg-error "expected" "expected" { target *-*-* } 42 } + ; + + struct B { operator int () { return 2; } }; + + if (struct B * foo = new B) + ; + + if (int f () = 1) // { dg-warning "extern" "extern" } + // { dg-error "is initialized like a variable" "var" { target *-*-* } 51 } + ; + + if (int a[2] = {1, 2}) // { dg-error "extended init" } + ; + +}
cond.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: delete1.C =================================================================== --- delete1.C (nonexistent) +++ delete1.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +#include +struct A { + virtual void operator delete (void *); // { dg-error "" } virtual delete + virtual void * operator new (size_t); // { dg-error "" } virtual new +};
delete1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access4.C =================================================================== --- access4.C (nonexistent) +++ access4.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// Simple testcase for access control. + +class A { +protected: + static int i; +}; + +class B: public A { }; + +class C: public B { +public: + void g () { B b; b.i; } +};
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: crash7.C =================================================================== --- crash7.C (nonexistent) +++ crash7.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ can't deal. + +typedef unsigned size_t; // { dg-error "" } previous declaration +typedef unsigned long size_t; // { dg-error "" } redefining size_t +void f (size_t); // causes compiler segfault -
crash7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lvalue.C =================================================================== --- lvalue.C (nonexistent) +++ lvalue.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// Bug: Scoped method calls don't propagate the constness of `this'. +// PRMS Id: 4181 (second testcase) + +class D; + +class Bptr +{ +public: + Bptr& operator=(D*); + const Bptr& operator=(const D*) const; +}; + +class Dptr : public Bptr +{ +public: + const Dptr& operator=(const D* rep) const + { + Bptr::operator=(rep); + return *this; + } +};
lvalue.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq5.C =================================================================== --- opeq5.C (nonexistent) +++ opeq5.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do run } +// Testcase for tricky synthesized op= in complex inheritance situation. +// This used to test whether the virtual base was copy-assigned only once. +// That feature is not required by ISO C++, so the test now only checks +// whether the vbase is assigned at all. + +int count = 0; +extern "C" int printf (const char *, ...); + +class A { + public: + A& operator = (const A&) { count++; return *this; } +}; + +class B: virtual private A { }; +class C: virtual public A { }; +class D: public B, public C { }; + +int main() +{ + D a, b; + a = b; + printf ("%d\n",count); + if (count == 0) + return 1; + return 0; +}
opeq5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend2.C =================================================================== --- friend2.C (nonexistent) +++ friend2.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// PRMS Id: 5189 +// Bug: g++ fails to collapse the several declarations of freefoo, so it isn't +// recognized as a friend. + +extern "C" +void freefoo(void); + +class foo { + friend void freefoo(void); + protected: + static void foomem(); + public: + foo(); + ~foo(); +}; + +void freefoo(void) +{ + foo::foomem(); +}
friend2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: local.C =================================================================== --- local.C (nonexistent) +++ local.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// General testcase for local classes. + +int x; +void f () +{ + static int s; + int x; // { dg-error "" } referenced below + extern int q(); + + struct local { + int g() { return x; } // { dg-error "" } automatic variable + int h() { return s; } // { dg-bogus "" } local class + int k() { return ::x; } // OK + int l() { return q(); } // OK + int m(); // OK - not defined + static int foo; // { dg-error "" } static data member of local class + }; +} + +local* p = 0; // { dg-error "" } no such type in scope
local.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,27 @@ +// { dg-do run } +// { dg-options "-fshort-enums" } + +// On ARM EABI targets this testcase will cause a warning to be emitted +// whilst EABI attributes are being merged at link time unless +// the --no-enum-size-warning option is passed to the linker. Whilst the +// enum-size attributes should only be emitted if there are values of +// enum type that can escape the compilation unit, gcc cannot currently +// detect this; if this facility is added then this linker option should +// not be needed. arm-*-linux*eabi should be a good approximation to +// those platforms where the EABI supplement defines enum values to be +// 32 bits wide. +// { dg-options "-fshort-enums -Wl,--no-enum-size-warning" { target arm*-*-linux*eabi } } + +#include + +enum A { a1 = 0x7fffffff }; +enum B { b1 = 0x80000000 }; +enum C { c1 = -1, c2 = 0x80000000 }; +enum D { d1 = CHAR_MIN, d2 = CHAR_MAX }; +enum E { e1 = CHAR_MIN, e2 = CHAR_MIN }; + +main() +{ + return (sizeof (A) != 4 || sizeof (B) != 4 || sizeof (C) != 8 + || sizeof (D) != 1 || sizeof (E) != 1); +}
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: lookup3.C =================================================================== --- lookup3.C (nonexistent) +++ lookup3.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// [class.ambig]: A single function, object, type, or enumerator may be +// reached through more than one path through the DAG of base classes. This +// is not an ambiguity. + +struct A { + typedef long T; +}; + +struct B : public A { }; +struct C : public A { }; + +struct D : public C , public B { + void f (T&); // { dg-bogus "" } ambiguous lookup +};
lookup3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: binding2.C =================================================================== --- binding2.C (nonexistent) +++ binding2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ screws up binding levels in a switch statement with cleanups. + +struct A { + ~A() { } +}; + +int f (int i) +{ + switch (i) { + default: + A a; + } + return 1; +} // causes compiler segfault
binding2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth7.C =================================================================== --- synth7.C (nonexistent) +++ synth7.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do run } +// Testcase to make sure that synthesized methods are found when needed. + +struct B { ~B() { } }; +struct A { B b; }; + +int main() +{ + A a, b (a), c = A(); + A& (A::*afp)(const A&) = &A::operator=; + (a.*afp) (b); +}
synth7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning7.C =================================================================== --- warning7.C (nonexistent) +++ warning7.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// { dg-options "-Wunused" } +// PRMS Id: 5481 + +struct A { }; +static A a = A();
warning7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmem.C =================================================================== --- pmem.C (nonexistent) +++ pmem.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// Bug: g++ parses the declaration of 'char A::* foo' below as a +// declaration of 'char A'. + +class A { }; +typedef int foo; +void f () +{ + char A::* foo; + foo = 0; // { dg-bogus "" } parsing blunder +}
pmem.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: typedef.C =================================================================== --- typedef.C (nonexistent) +++ typedef.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// PRMS Id: 4687 +// Bug: g++ misinterprets typedefs of function type in class scope. + +typedef int (*F1) (); +struct A { + typedef int F(); + F *fp; + F1 g() { return fp; } // { dg-bogus "" } typing +};
typedef.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg4.C =================================================================== --- rfg4.C (nonexistent) +++ rfg4.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// { dg-options "-ansi -pedantic-errors -w" } +// Bug: f1 and f2 are treated as overloaded when they aren't. + +int i; +void f1(double) { } +void f2(double) { } + +void +test () +{ + i ? f1 : f2; // { dg-bogus "" } improper overloading +}
rfg4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping.C =================================================================== --- scoping.C (nonexistent) +++ scoping.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 3977 +// Bug: A member function is not hidden properly by a later use of its name. + +struct A { + void index (); +}; + +struct B: A { + int index; + B(): index(4) {} +};
scoping.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access11.C =================================================================== --- access11.C (nonexistent) +++ access11.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 4900 +// Bug: g++ doesn't apply access control uniformly to type conversion operators + +struct A { +protected: + operator int * () const; +}; + +struct B : public A { + int * foo () { return A::operator int *(); } +};
access11.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping12.C =================================================================== --- scoping12.C (nonexistent) +++ scoping12.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +void f () +{ + struct A { + friend void g (); // { dg-error "without prior declaration" } + }; +} +void h () { + g (); // { dg-error "" } no g in scope +}
scoping12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lineno2.C =================================================================== --- lineno2.C (nonexistent) +++ lineno2.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "" } +// GROUPS passed error-reporting +// Bug: # line directive gets ignored immediately after text. +template class A +{ +public: +# 200 "lineno2.C" +}; + +main() +{ + undef1(); // { dg-error "" "" { target *-*-* } 204 } +}
lineno2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary5.C =================================================================== --- temporary5.C (nonexistent) +++ temporary5.C (revision 338) @@ -0,0 +1,19 @@ +// PRMS Id: 6604 +// Old bug: Scoped constructor call is not properly recognized as a functional cast +// But after DR 147 A::A() is a constructor call, not a functional cast. + +int c; + +struct A { + A() { ++c; } + ~A() { --c; } + operator int () { return 1; } +}; + +int main () +{ + A a; + a.A::A(); // { dg-error "" } + A::A(); // { dg-message "" } + return c; +}
temporary5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested6.C =================================================================== --- nested6.C (nonexistent) +++ nested6.C (revision 338) @@ -0,0 +1,5 @@ +// { dg-do assemble } +union A { + struct B { }; + A::B b; // { dg-bogus "" } +};
nested6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cleanup2.C =================================================================== --- cleanup2.C (nonexistent) +++ cleanup2.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// PRMS Id: 6303 +// Bug: compiler crashes processing the cleanup for arrayOfClass. + +class Klasse { +public: + ~Klasse(); // This dtor MUST be declared to generate the error... +}; + +Klasse varOfClass; + +int main() { + // This MUST be 'const' to generate the error... + const Klasse arrayOfClass[1] = { varOfClass }; // causes abort +}
cleanup2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lvalue3.C =================================================================== --- lvalue3.C (nonexistent) +++ lvalue3.C (revision 338) @@ -0,0 +1,9 @@ +// { dg-do assemble } +// Bug: C++ semantics for assignment don't match the backend semantics for +// MODIFY_EXPR. + +void +foo (int j) +{ + (j = 1)++; // causes compiler segfault +}
lvalue3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: jump.C =================================================================== --- jump.C (nonexistent) +++ jump.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// PRMS Id: 6036 + +extern int a; + +int main() { + switch (a) { + case 1: + int v2 = 3; // { dg-error "" } referenced below + case 2: // { dg-error "" } jumping past initializer + if (v2 == 7) + ; + } + return 0; +}
jump.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: report.C =================================================================== --- report.C (nonexistent) +++ report.C (revision 338) @@ -0,0 +1,77 @@ +// { dg-do assemble } +// { dg-options "-Wreturn-type" } +// GROUPS passed error-reporting + +// DR 295 allows qualification via typedef + +template +class badoo +{ +}; + +template +class doowop +{ +}; + +struct A +{ + int a; + ~A () { a = 0; } + operator int () { return a; } +}; + +extern "C" int atoi (const char *); + +int (*fee)(const char *) = atoi; +int (**bar)(const char *) = &fee; + +const char* s = "4"; +const char** sp = &s; +const char*** spp = &sp; + +int foo (int a = (**bar) (s)) +{ + return doowop::bar; // { dg-error "" } not a member +} + +int foo2 (int (*a)(int) = &foo) +{ + undef4 (1); // { dg-error "" } implicit declaration + return 1; +} + +class X{ + class Y{}; // { dg-error "" } private +}; + +typedef int const * bart (); +//The following is DR295 dependant +typedef bart const * const * bar2; +typedef bart volatile * const * bar2v; + +bar2 baz (X::Y y) // { dg-error "" } in this context +{ + X::Y f; // { dg-error "" } in this context + bar2 wa [5]; + wa[0] = baz(f); + undef2 (1); // { dg-error "" } implicit declaration +} // { dg-warning "no return statement" } + +int ninny () +{ + struct A + { + static int ninny2 () { return badoo<'\001'>::foo; } // { dg-error "" } not a member + }; + + return A::ninny2(); +} + +int darg (char X::*p) +{ + undef3 (1); // { dg-error "" } implicit declaration +} // { dg-warning "no return statement" } + +// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 36 } +// { dg-message "warning: control reaches end of non-void function" "" { target *-*-* } 65 }
report.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: inline.C =================================================================== --- inline.C (nonexistent) +++ inline.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do run } +// PRMS Id: 4341 +// Bug: Instantiating a template in the middle of processing the functions +// from another template screws up lineno/input_filename. + +#pragma implementation "C.h" +#line 1 "A.h" +#pragma interface +template class A {}; +#line 1 "C.h" +#pragma interface +template class C +{ +public: + C() { A *ap; } + ~C() { } +}; +#line 18 "inline.C" +int main() +{ + C c; +}
inline.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template21.C =================================================================== --- template21.C (nonexistent) +++ template21.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Gosh, this works! + +template +struct A +{ + struct B + { + void bar(); + }; + struct C { }; +}; + +template void A::B::bar() { } + +template class A;
template21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: redecl1.C =================================================================== --- redecl1.C (nonexistent) +++ redecl1.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +class A +{ +public: + A (const A& ccref); + friend A const re (const A& v1); // { dg-error "ambiguates" } +}; + +A // const +re (const A& ref) // { dg-error "new declaration" } +{ + return A (ref); +}
redecl1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: return.C =================================================================== --- return.C (nonexistent) +++ return.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do run } +// PRMS Id: 5331 +// Bug: the return value of foo is constructed in a temporary and then +// copied into the return slot. This is not necessary. + +int c = 0; + +struct X { + X(int i) { } + X(X const &XX) { c = 1; } + ~X() { } +}; + +const X foo() { + return X(3); +} + +int main() +{ + foo(); + return c; +}
return.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload23.C =================================================================== --- overload23.C (nonexistent) +++ overload23.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// From: panisset@cae.ca (Jean-Francois Panisset) +// Date: Mon, 6 Jun 94 13:39:25 EDT +// Subject: Problem with operator overloading + + +class ostream { +public: + ostream& operator<<(double n); + ostream& operator<<(float n); +}; + +class X +{ +public: + operator long() const; + operator double() const; +}; +ostream& operator<< (ostream& os, const X& x); + + +int main() +{ + X x; + ostream os; + os << x; // { dg-bogus "" } converting to float +}
overload23.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: special.C =================================================================== --- special.C (nonexistent) +++ special.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Make sure that forward declarations of specializations work... + +template class A { }; +template <> class A; +A a; // { dg-error "" } incomplete type +template <> class A { };
special.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: destruct4.C =================================================================== --- destruct4.C (nonexistent) +++ destruct4.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// PRMS Id: 4342 +// Bug: g++ fails to massage ambiguity in calling virtual destructor. + +class A { public: virtual ~A();}; +class B: public A { }; +class C: public A { }; +class D: public B, public C { }; + +void foo () +{ + D* p = new D; + delete p; +}
destruct4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg21.C =================================================================== --- rfg21.C (nonexistent) +++ rfg21.C (revision 338) @@ -0,0 +1,2 @@ +// { dg-do assemble } +char array0[4] = "abcde"; /* { dg-error "" } initializer too long */
rfg21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rvalue3.C =================================================================== --- rvalue3.C (nonexistent) +++ rvalue3.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +int main () +{ + int i; + int &ir = (int&)(int)i; // { dg-error "" } casting rvalue to reference type +}
rvalue3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempdest.C =================================================================== --- tempdest.C (nonexistent) +++ tempdest.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// GROUPS passed templates destructors +// Example of PR 3308 workaround + +template +class A +{ + T q; +public: + ~A() { (&q)->T::~T(); } +}; + +typedef unsigned int ui; + +int main() +{ + A *ap = new A; + + delete ap; +}
tempdest.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template29.C =================================================================== --- template29.C (nonexistent) +++ template29.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// PRMS Id: 9500 + +template +class base + { +public: + inline base(); + }; + +template +class derived : public base + { +public: + inline derived(); + }; + +template +inline derived::derived() : base(){}
template29.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping6.C =================================================================== --- scoping6.C (nonexistent) +++ scoping6.C (revision 338) @@ -0,0 +1,27 @@ +// { dg-do assemble } +// Testcase for all uses of explicit global scope. + +int a, B; + +struct A { }; +int operator+(A&, int); + +struct B { + struct C { + static int a; + static int f () { A a; return ::operator+ (a, ::a); } // { dg-bogus "" } + }; +}; + +int B::C::a = 0; + +struct D : public ::B::C { }; // { dg-bogus "" } + +void f () +{ + int B; + ::B::C b; + + B = ::B::C::a; // { dg-bogus "" } + B = ::B::C::f(); // { dg-bogus "" } +}
scoping6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: complete1.C =================================================================== --- complete1.C (nonexistent) +++ complete1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// PRMS Id: 4695 +// Bug: g++ wrongly requires A to be complete here. + +struct A; + +void foo(const A &); + +void bar(A *p) +{ + foo(*p); +}
complete1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ctor2.C =================================================================== --- ctor2.C (nonexistent) +++ ctor2.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Bug: the reference to c in the initializer list doesn't get fixed up. + +struct AP { + AP(unsigned char); +}; + +struct AI : AP { + AI(unsigned char); +}; + +AI::AI(unsigned char c) +: AP(c) +{ + &c; +}
ctor2.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,15 @@ +// { dg-do run } +// PRMS Id: 4679 +// Bug: g++ doesn't re-instantiate templates after definition is seen. + +template struct A; + +A *a; + +template struct A { T t; }; + +int main() +{ + if (a) + a->t = 1; // { dg-bogus "" } +}
template3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload5.C =================================================================== --- overload5.C (nonexistent) +++ overload5.C (revision 338) @@ -0,0 +1,5 @@ +// { dg-do assemble } +// Testcase for simple overloading resolution. + +int foo (); // { dg-error "" } +void foo (); // { dg-error "" } disallowed overload
overload5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ambig1.C =================================================================== --- ambig1.C (nonexistent) +++ ambig1.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// { dg-options "-pedantic-errors" } +// Testcase for ambiguity between functional cast and abstract declarator. +// This ambiguity accounts for 6 of the r/r conflicts. + +int i = sizeof (int ()); // { dg-error "" } sizeof applied to fn type +int j = sizeof (int () + 1);
ambig1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempparse.C =================================================================== --- tempparse.C (nonexistent) +++ tempparse.C (revision 338) @@ -0,0 +1,29 @@ +// { dg-do assemble } +/* + PRMS Id: 3631 + Bug is: g++ mangles template class names in a way that it won't accept, + and then tries to feed them to itself. +*/ + +template +struct A { + A(); +}; + +template +struct B : A { + B(); +}; // { dg-bogus "" } B> + +template +struct C { + C(); +}; + +template +struct D { + D(); + B > p_f; +}; + +typedef D Dummy;
tempparse.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse7.C =================================================================== --- parse7.C (nonexistent) +++ parse7.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Bug: g++ tries to parse this as a constructor. + +typedef int foo; +struct A { + foo (*bar)(); +};
parse7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access20.C =================================================================== --- access20.C (nonexistent) +++ access20.C (revision 338) @@ -0,0 +1,39 @@ +// { dg-do assemble } +// PRMS Id: 6662 +// Bug: we crash trying to check the access on anglesSinesCosines. + +#define Double double + +class GCTransform +{ + protected: + struct angle + { + Double phi1 ; + Double phi2 ; + } ; + + struct sineAndCosine + { + Double cosine1 ; + Double cosine2 ; + Double sine1 ; + Double sine2 ; + } ; + + union anglesSinesCosines + { + struct angle a ; + struct sineAndCosine siCo ; + } ; +}; + +class GCTransTransmit : public GCTransform +{ + protected: + + struct GCTransTransmitDataTemp + { + union anglesSinesCosines t ; // causes abort + } ; +} ;
access20.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref8.C =================================================================== --- ref8.C (nonexistent) +++ ref8.C (revision 338) @@ -0,0 +1,18 @@ +// { dg-do run } +// PRMS Id: 5184 +// Bug: cast to C& below does not adjust address + +struct A {}; +struct B { + virtual void foo () {} +}; +struct C : public B, public A {}; + +int main() { + C c; + + A& ar = c; + C& cr = (C&)ar; + + cr.foo(); // this line causes core dump +}
ref8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default1.C =================================================================== --- default1.C (nonexistent) +++ default1.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 5204 +// Bug: g++ bashes the type of add_sym with the type of add, so calling it +// with one parameter generates an error. + +int add(int const &symbol, + const unsigned char flags=(void*)0); // { dg-error "" } invalid default arg + +int add_sym(int const &symbol, + const unsigned char flags=0); + +int main() +{ + int fname; + add_sym(fname); // Guarantee a symbol exists +}
default1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf5.C =================================================================== --- pmf5.C (nonexistent) +++ pmf5.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// { dg-options "" } +// PRMS Id: 4985 + +struct Thing { + int OverloadFn() const; + void FunctionA(char* restOfLine); + void OverloadFn(char* restOfLine); +}; + +struct ThingEntry { + void (Thing::*_handler)(char* restOfLine); +}; + +static ThingEntry KeyWordTable[] = { + &Thing::FunctionA, + Thing::OverloadFn, +}; // { dg-error "assuming" "assuming" } implicit & +// { dg-message "note" "note" { target *-*-* } 18 }
pmf5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool3.C =================================================================== --- bool3.C (nonexistent) +++ bool3.C (revision 338) @@ -0,0 +1,13 @@ +// { dg-do assemble } +// From: panisset@cae.ca (Jean-Francois Panisset) +// Subject: Problem with constant expressions for bitfields +// Date: Mon, 6 Jun 94 14:00:01 EDT + +// Bug: g++ doesn't treat boolean true and false as constant values. + +enum E { e1,e2,e3,e4,e5 }; + +struct X +{ + unsigned int bits : ((e5 > 4) ? 8 : 4); // { dg-bogus "" } constant expression +};
bool3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion9.C =================================================================== --- conversion9.C (nonexistent) +++ conversion9.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do run } +// PRMS Id: 8475 + +class SomeClass { +public: + operator int & () { + static int x; + return x; + } +} a; + +int main (int, char**) { + return a + 0; +}
conversion9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template30.C =================================================================== --- template30.C (nonexistent) +++ template30.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +template +int func(U, T); // { dg-message "candidates" } + +template +int func(T, U) // { dg-message "note" } +{ + return 2; +} + +int main () +{ + func (0, 1); // { dg-error "ambiguous" } +}
template30.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload32.C =================================================================== --- overload32.C (nonexistent) +++ overload32.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// PRMS Id: 7128 + +class B {}; + +class D : public B {}; + +class X { + public: + operator const B & () const; + operator const D & () const; +}; + +void f( const D & ); + +void g( const X & x ) +{ + f( x ); +}
overload32.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload15.C =================================================================== --- overload15.C (nonexistent) +++ overload15.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +// Bug: g++ thinks that int->long is a promotion. + +long f (long, long); +double f (double, double); + +void g (double d) +{ + f (d, 0); +}
overload15.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: explicit.C =================================================================== --- explicit.C (nonexistent) +++ explicit.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Testcase for explicit instantiation of templates. + +template +class A { + T t; +public: + void f () { } +}; + +template class A; + +template T min (T a, T b) { return (a < b ? a : b); } + +template int min (int, int);
explicit.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg13.C =================================================================== --- rfg13.C (nonexistent) +++ rfg13.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ does overloading on a function-by-function basis. + +void +f () +{ + void (*fp)(void); + { + extern void g (); + } + fp = g; /* { dg-error "" } no 'g' in scope */ +}
rfg13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary.C =================================================================== --- temporary.C (nonexistent) +++ temporary.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// From: bruno@isoft.com.ar (Bruno R. Depascale) +// Subject: No destructor bug +// Date: Mon, 14 Feb 1994 12:49:45 -0300 (Arg) + +// Bug: temporaries created with constructor notation aren't destroyed. + +int count = 0; + +class A { +public: + A() { ++count; } + ~A() { --count; } +}; + +int main() +{ + A(); + return count; +}
temporary.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tredecl.C =================================================================== --- tredecl.C (nonexistent) +++ tredecl.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// Bug: Foo *p semi-instantiates Foo in local scope, so +// when Foo f tries to instantiate it later, it only finds the partial +// instantiation from before. +// +// No PR; distilled from James Clark's SGML project. +// + +class Bar { }; + +template class Foo; + +Foo *p; + +template class Foo { }; + +Foo f; // { dg-bogus "" } hosed binding levels
tredecl.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mangle1.C =================================================================== --- mangle1.C (nonexistent) +++ mangle1.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// Bug: numeric_outputed_need_bar is not cleared properly, adding random '_'s +// to mangled names. + + +template +class rand1 +{ +public: + rand1 (); +}; + +class codes +{ +public: + rand1<32> * randgen; + codes (int ptr); + +}; + +codes::codes (int ptr) +{ +}
mangle1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: delete2.C =================================================================== --- delete2.C (nonexistent) +++ delete2.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 5003 +// Bug: g++ complains about calling the destructor for a const object. + +struct A { +public: + ~A(); +}; + +const A foo (); + +void bar() +{ + A n; + n = foo(); // { dg-bogus "" } deleting const +}
delete2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access5.C =================================================================== --- access5.C (nonexistent) +++ access5.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Simple testcase for access control. + +class A { + protected: + void f (); +}; + +class B : public A { }; +class C : public B { + void f () { B::f(); } +};
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: crash8.C =================================================================== --- crash8.C (nonexistent) +++ crash8.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } +struct A { + A(); + A(A); // { dg-error "" } copy ctor must take reference +}; +int main() +{ + A a; + A b(a); // causes compiler segfault +}
crash8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: opeq6.C =================================================================== --- opeq6.C (nonexistent) +++ opeq6.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do assemble } +// Testcase for wrongful generation of operator =. + +class ivResource { +public: + ivResource (); +private: + ivResource & operator =(const ivResource &); +}; + +class ivButtonState : virtual public ivResource { +public: + void operator=(ivButtonState &); +}; + +class ivPrintBS : public ivButtonState { +}; + +void f () +{ + ivPrintBS a, b; + a = b; +} +
opeq6.C Property changes : Added: svn:eol-style ## -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 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Yet Another testcase for signed/unsigned enums. + +enum A { AA = 0, AB = 1}; +enum B { BA = -1, BB = 1}; + +void set(int a); +void set(long a); + +void +foo() +{ + set(AA); // { dg-bogus "" } why is this ambiguous + set(BA); // when this is not amibguous +}
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: binding3.C =================================================================== --- binding3.C (nonexistent) +++ binding3.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// Bug: g++ fails to clear out the IDENTIFIER_CLASS_VALUEs of various names +// after a class definition. + +struct A { + typedef double T; + virtual T f () = 0; +}; + +class B { + B (const B&); + void operator=(const B&); +public: + B (); + typedef void * T; +}; + +struct C : public A { + T f (); // { dg-bogus "" } +};
binding3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: synth8.C =================================================================== --- synth8.C (nonexistent) +++ synth8.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do assemble } +// Bug: the synthesized constructor for A tries to use the mem-initializer +// list for the B constructor. + +struct A +{ + virtual ~A(); +}; + +struct B +{ + B(); + char* x; + A* a; +}; + +B::B() +: x(0), a(new A()) +{ +}
synth8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning8.C =================================================================== --- warning8.C (nonexistent) +++ warning8.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } + +struct A { + A(); + ~A(); +}; + +struct B { + B (const A&); + ~B (); +}; + +const B& f () +{ + A a; + return a; // { dg-warning "" } returning reference to temporary +}
warning8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: condexp.C =================================================================== --- condexp.C (nonexistent) +++ condexp.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// PRMS id: 5629 + +struct String { const char *x; }; +class Pathname: public String { }; + +String +f(int i) +{ + Pathname p; + String s; + + return i ? p: s; +}
condexp.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg5.C =================================================================== --- rfg5.C (nonexistent) +++ rfg5.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// { dg-options "-ansi -pedantic-errors -w" } +// Bug: func is treated as an overloaded function when it isn't. + +int *func () { return 0; } + +void +test () +{ + *func; // { dg-bogus "" } improper overloading +}
rfg5.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access12.C =================================================================== --- access12.C (nonexistent) +++ access12.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// PRMS Id: 4694 +// Bug: g++ doesn't realize that A::i refers to a member of `this' in B(). + +class A { +protected: + int i; +}; + +struct B : public A { + B () { A::i = 0; } +}; + +struct C : public B { + C () { B::i = 0; } +};
access12.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping13.C =================================================================== --- scoping13.C (nonexistent) +++ scoping13.C (revision 338) @@ -0,0 +1,10 @@ +// { dg-do assemble } + +struct A { typedef int foo; }; +struct B: public A { + typedef int bar; + struct C { + void g (B::bar); // { dg-bogus "" } nested type failure + void f (B::foo); + }; +};
scoping13.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: offset1.C =================================================================== --- offset1.C (nonexistent) +++ offset1.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do assemble } +// PRMS Id: 5070 (testcase 1) + +struct foo { + foo(int x = 0) {} + int IsAlive(void) { return 1; } +}; + +struct xx { + int IsOk(int X); + foo a; +}; + +int xx::IsOk(int X) +{ + return ((xx::a).IsAlive()); // { dg-bogus "" } +}
offset1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lineno3.C =================================================================== --- lineno3.C (nonexistent) +++ lineno3.C (revision 338) @@ -0,0 +1,14 @@ +// { dg-do assemble } +// { dg-options "" } +// GROUPS passed error-reporting +// potential bug: # line directive does not get reproduced in template +// expansion +template class A +{ +public: +# 200 "lineno3.C" + int foo () { undef1(); } // { dg-error "" "" { target *-*-* } 200 } + // { dg-message "note" "note" { target *-*-* } 200 } +}; + +template class A;
lineno3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: friend.C =================================================================== --- friend.C (nonexistent) +++ friend.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// Bug: g++ doesn't keep track of the lexical context of friends properly. + +extern "C" void exit(int); + +struct B; +struct A { + static void f () { exit (1); } +}; + +struct B { + static void f () { exit (0); } + friend void g (B) { f (); } +}; + +int main () +{ + B b; + g (b); +}
friend.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: temporary6.C =================================================================== --- temporary6.C (nonexistent) +++ temporary6.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: the temporary from the default parameter to f2 is reused. + +struct A {}; +int f2 (int i, const A& ar = A()); +void f (int i, int j = f2(1)); +void g () { f (1); } +void h () { f (1); }
temporary6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: nested7.C =================================================================== --- nested7.C (nonexistent) +++ nested7.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +// Testcase for defining nested types separately. + +class remote +{ + class remote_file; +}; + +class remote::remote_file +{ +public: + ~remote_file(); +}; + +remote::remote_file::~remote_file() +{}
nested7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse10.C =================================================================== --- parse10.C (nonexistent) +++ parse10.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do run } +// Testcase for precedence of ?: wrt = + +extern "C" int printf (const char *, ...); + +int main() +{ + int j = 0, k = 0; + 1 ? j : k = 5; // should be parsed 1 ? j : (k = 5) + (void) (1 ? k = 5 : 0); + k = 5 ? 1 : 0; // should be parsed k = (5 ? 1 : 0) + + printf ("%d %d\n", j, k); + + return j == 5 || k == 5; +}
parse10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: lvalue4.C =================================================================== --- lvalue4.C (nonexistent) +++ lvalue4.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do run } +int main() { + int i = 2; + int *pi = &(++i); + + return i != 3; +}
lvalue4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref10.C =================================================================== --- ref10.C (nonexistent) +++ ref10.C (revision 338) @@ -0,0 +1,32 @@ +// { dg-do run } +// Test that conversion from D* to B*& works properly. + +extern "C" int printf (const char *, ...); + +struct V { + int a; +}; + +struct B: virtual V { + int b; +}; + +struct D: B { + int c; +}; + +V* gp = 0; + +void foo(V * const &r) { + gp = r; +} + +int bar(V *r) { + return (r != gp); +} + +int main() { + D *p = new D; + foo(p); + return bar(p); +}
ref10.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: byval.C =================================================================== --- byval.C (nonexistent) +++ byval.C (revision 338) @@ -0,0 +1,20 @@ +// { dg-do run } +// Bug: a is destroyed in both foo() and main() + +int count; + +struct A { + double a,b; + A(int) { count++; } + A(const A&) { count++; } + ~A() { count--; } +}; + +void foo (A a) +{ } + +int main() +{ + foo (1); + return count; +}
byval.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template22.C =================================================================== --- template22.C (nonexistent) +++ template22.C (revision 338) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// Testcase for proper unification of code involving references. + +template +struct A +{ + void foo(); +}; + +template void A::foo() { } + +template class A; + +const int& f1 (); +int& f2 (); +int f3 (); + +template void g1 (const T&); +template void g2 (T&); +template void g3 (T); + +int main() +{ + g1 (f1 ()); + g1 (f2 ()); + g1 (f3 ()); + g2 (f2 ()); + g3 (f1 ()); + g3 (f2 ()); + g3 (f3 ()); +}
template22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload24.C =================================================================== --- overload24.C (nonexistent) +++ overload24.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// PRMS Id: 5124 +// Bug: g++ promotes bar to int* too soon and the call to f fails. + +typedef int arr[1]; + +struct A { + void f(void); + void f(arr &); + + void g(void); + void g(int *); + + void h(void); +}; + + +void A::h(void) +{ + arr bar; + f(bar); + g(bar); +}
overload24.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf.C =================================================================== --- pmf.C (nonexistent) +++ pmf.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// PRMS Id: 4333 +// Bug: g++ can't deal with casts to pointer to member function. + +class A { }; +typedef void (A::* pmf)(); +void foo () { (pmf) 0; }
pmf.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg22.C =================================================================== --- rfg22.C (nonexistent) +++ rfg22.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +static void f (); // { dg-error "" } used but not defined + +void g () +{ + f (); +}
rfg22.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: cleanup.C =================================================================== --- cleanup.C (nonexistent) +++ cleanup.C (revision 338) @@ -0,0 +1,24 @@ +// { dg-do run } +// Bug: continue over object decl calls destructor but not constructor. + +int c = 0; +int d = 0; +extern "C" int printf(const char *,...); + +class Foo { +public: + Foo(){ c++; } + ~Foo(){ d++; } +}; + +int main() +{ + for(int i=0;i<2;i++){ + continue; + Foo bar; + } + printf ("%d %d\n", c, d); + if (c == d && d == 0) + return 0; + return 1; +}
cleanup.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: tempcons.C =================================================================== --- tempcons.C (nonexistent) +++ tempcons.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: member initializers are allowed where they shouldn't be. + +template +struct A { + int i; + Blarg () : i(0) { } // { dg-error "" } +};
tempcons.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: scoping7.C =================================================================== --- scoping7.C (nonexistent) +++ scoping7.C (revision 338) @@ -0,0 +1,6 @@ +// { dg-do assemble } +// Bug: g++ doesn't flag name collisions between types and non-types as +// errors. It shouldn't for class names, but it should for typedefs. + +int bar; // { dg-error "" } +typedef int bar; // { dg-error "" }
scoping7.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref1.C =================================================================== --- ref1.C (nonexistent) +++ ref1.C (revision 338) @@ -0,0 +1,8 @@ +// { dg-do assemble } +// Bug: g++ tries to call a constructor for a reference. Doh! + +class B; +struct A { + B & b; + A (B & x) : b (x) { } // { dg-bogus "" } +}; // { dg-bogus "" }
ref1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: expr1.C =================================================================== --- expr1.C (nonexistent) +++ expr1.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Bug: g++ doesn't figure out what to do. + +struct A { + operator char *(); +}; + +char foo(A a) +{ + char c = a[0]; // { dg-bogus "" } + return c; +}
expr1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template4.C =================================================================== --- template4.C (nonexistent) +++ template4.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do assemble } +// Bug: g++ tries to instantiate ccList twice, and fails. + +template class ccHandle{ }; +template class ccList; +template class cc_List { +public: + ccList copy (); +}; + +template class ccList : public ccHandle < cc_List > { +public: + ccList (int); +}; + +template +ccList cc_List::copy (){} + +int main (int, char **) { + ccList size1(); +}
template4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload6.C =================================================================== --- overload6.C (nonexistent) +++ overload6.C (revision 338) @@ -0,0 +1,15 @@ +// { dg-do assemble } +// Bug: g++ thinks there is a default conversion from void* to B*. +// There isn't. + +struct A { + operator void* (); +}; + +struct B { }; + +void foo (B* bp); + +void bar (A& a) { + foo (a); // { dg-error "" } +}
overload6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ambig2.C =================================================================== --- ambig2.C (nonexistent) +++ ambig2.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// { dg-options "-Wno-pointer-arith" } +// Testcase for ambiguity between cast and parmlist. +// This ambiguity accounts for 1 of the r/r conflicts. +// Do not compile with -pedantic so that the compiler will accept taking +// the sizeof a function type. + +void f(){ + (void)sizeof(int((int)1.2)); + (void)sizeof(int((int))); // { dg-bogus "" } +}
ambig2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: parse8.C =================================================================== --- parse8.C (nonexistent) +++ parse8.C (revision 338) @@ -0,0 +1,2 @@ +// { dg-do assemble } +void foo(const int* const); // { dg-bogus "" }
parse8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access21.C =================================================================== --- access21.C (nonexistent) +++ access21.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// PRMS Id: 6877 + +typedef __SIZE_TYPE__ size_t; +class aa { +public: + aa(); + ~aa(); +private: + int iaa; + void operator delete(void*, size_t); +}; + +class bb { +public: + aa caa; +}; // { dg-bogus "" } calling private delete + +void +f(){ + bb abb; +}
access21.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: ref9.C =================================================================== --- ref9.C (nonexistent) +++ ref9.C (revision 338) @@ -0,0 +1,26 @@ +// { dg-do run } +// Bug: g++ re-evaluates the initializer for r before calling f(); since i has +// changed to an invalid index, this breaks. + +class C +{ +public: + void f () { } +}; + +void foo (C * objs[]) +{ + int i = 0; + C & r = * objs[i]; /* make reference to element */ + + i = 666; + r.f (); /* core dumps here */ +} + +int +main () +{ + C * objs[1] = { new C }; + + foo (objs); +}
ref9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: default2.C =================================================================== --- default2.C (nonexistent) +++ default2.C (revision 338) @@ -0,0 +1,31 @@ +// { dg-do assemble } +// PRMS Id: 5921 +// Bug: default arguments containing constructor calls persist incorrectly. + +class foo +{ + public: + foo(); + foo(int x); + public: + int iamamember; +}; + +class bar +{ + public: + bar(); + int memberfunction(int i, const char *j, double k, foo foo1 = foo(0)); +}; + +int +pain(bar *bar1) +{ + return bar1->memberfunction(1, "x", 0.0); +} + +int +pain2(bar *bar1) +{ + return bar1->memberfunction(1, "x", 0.0); +}
default2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: conversion2.C =================================================================== --- conversion2.C (nonexistent) +++ conversion2.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// PRMS Id: 3069 + +void f(int&); // { dg-error "" } referenced by error below +void g(const int& i) { + f(i); // { dg-error "" } discarding const +}
conversion2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: pmf6.C =================================================================== --- pmf6.C (nonexistent) +++ pmf6.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do assemble } +// PRMS Id: 5656 +// Bug: g++ tries (which is a bug) and fails (which is a bug) to initialize +// var at runtime. + +struct A +{ + int func(int); + int func() const; +}; +int (A::* var) () const = & A::func;
pmf6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: bool4.C =================================================================== --- bool4.C (nonexistent) +++ bool4.C (revision 338) @@ -0,0 +1,11 @@ +// { dg-do run } +// Test for allowing conversion to bool. + +struct A { }; + +int main () +{ + bool b = (void*)0; + b = (int A::*)0; + b = (int (A::*)())0; +}
bool4.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template31.C =================================================================== --- template31.C (nonexistent) +++ template31.C (revision 338) @@ -0,0 +1,40 @@ +// { dg-do run } +// PRMS Id: 8569 + +#include +#include +#include + +using std::vector; + +class Component { + int george; + char mabel[128]; +}; +class CopyMe { +public: + CopyMe(){;} +private: + vector strvec; +}; + +class IncludeIt { +public: + IncludeIt() {} + ~IncludeIt() {} + IncludeIt(const IncludeIt& i) { + myStrvec = i.myStrvec; + } + IncludeIt& operator=(const IncludeIt& i) { + myStrvec = i.myStrvec; + return *this; + } +private: + CopyMe myStrvec; +}; + +int main(int argc, char**argv) { + IncludeIt foo; + IncludeIt* bar; + std::exit(0); +}
template31.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template14.C =================================================================== --- template14.C (nonexistent) +++ template14.C (revision 338) @@ -0,0 +1,17 @@ +// { dg-do run } +// PRMS Id: 4745 +// Bug: g++ gets the constructor and destructor confused because the default +// parm prevents the two constructor types from satisfying ==. + +template struct A { + A(int = 1); + ~A(); +}; + +template A::A(int) { } // causes compiler abort +template A::~A() { } + +int main() +{ + A a; +}
template14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload33.C =================================================================== --- overload33.C (nonexistent) +++ overload33.C (revision 338) @@ -0,0 +1,78 @@ +// { dg-do assemble } +// PRMS ID: 7507 + +/* ------------------------------------------------------------ */ + +class Base0 +{ +public: + Base0() {} + virtual ~Base0() {} +}; + +class Base1 +{ +public: + Base1() {} + virtual ~Base1() {} +}; + +class Derived : public Base0, public Base1 +{ +public: + Derived() {} + virtual ~Derived() {} +}; + +/* ------------------------------------------------------------ */ + +class Dummy +{ + public: + Dummy(Base0 * theBase) {} + ~Dummy() {} +}; + +/* ------------------------------------------------------------ */ + +template +class ConstSmartPtr +{ + T* myItem; // private + + public: + ConstSmartPtr(T const* theItem); + + operator T const*() const + { return myItem; } + protected: + T* _item() const + { return myItem; } +}; + +template +class SmartPtr : public ConstSmartPtr +{ + public: + SmartPtr(T* theItem) + : ConstSmartPtr(theItem) {} + + T* item() const + { return this->_item(); } + + operator T*() const + { return this->_item(); } +}; + +/* ------------------------------------------------------------ */ + +void +function() +{ + SmartPtr myObj = new Derived(); + + Dummy th1(myObj); // Doesn't work under Cygnus + Dummy th2((Base0 *) myObj); // Doesn't work either +} + +/* ------------------------------------------------------------ */
overload33.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash1.C =================================================================== --- crash1.C (nonexistent) +++ crash1.C (revision 338) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// Bug: g++ dies on this input. + +class Sample + { + public: + int operator <<(const char *c); + }; + +extern Sample sample; + +struct Simple + { + int a; + }; + +extern "C" void get_it(); + +class Test + { + private: + void test(); + friend void get_it(); + }; + +void Test::test() + { + sample << "hello"; + }
crash1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: overload16.C =================================================================== --- overload16.C (nonexistent) +++ overload16.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +void f (int); // { dg-message "candidates" } +void f (long); // { dg-message "note" } +int main() +{ + f (1 & 0xffffff00UL); // { dg-error "ambiguous" } +}
overload16.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: rfg14.C =================================================================== --- rfg14.C (nonexistent) +++ rfg14.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do assemble } +void *vp; +int (*ap)[]; +struct S *sp; +union U *up; +int (*fp)(); + +void +test () +{ + vp++; /* { dg-error "" } incrementing void * */ + ap++; /* { dg-error "" } incrementing ptr to incomplete type */ + sp++; /* { dg-error "" } incrementing ptr to incomplete type */ + up++; /* { dg-error "" } incrementing ptr to incomplete type */ + fp++; /* { dg-error "" } incrementing ptr to function */ +}
rfg14.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: mangle2.C =================================================================== --- mangle2.C (nonexistent) +++ mangle2.C (revision 338) @@ -0,0 +1,23 @@ +// { dg-do assemble } +// I guess this was broken once. + +template class X { }; +typedef X T; + +class Y +{ + public: + ~Y(); +}; + +class Z +{ + public: + void f(T**); +}; + +void Z::f(T** t) +{ } + +Y::~Y() +{ }
mangle2.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: delete3.C =================================================================== --- delete3.C (nonexistent) +++ delete3.C (revision 338) @@ -0,0 +1,19 @@ +// { dg-do assemble } +// PRMS Id: 6093 + +class A { +public: + A(); + ~A(); +protected: + void operator delete(void *); // { dg-error "" } protected +}; + +A::~A() +{ +} + +void foo(A *p) +{ + delete p; // { dg-error "" } in this context +}
delete3.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: defctor.C =================================================================== --- defctor.C (nonexistent) +++ defctor.C (revision 338) @@ -0,0 +1,16 @@ +// { dg-do run } +// Bug: g++ doesn't generate default constructor. + +class A { +public: + int i; +}; + +extern "C" int printf(const char *, ...); + +int main () { + A a; + a.i = 1; + A b (a); + printf("%d\n",b.i); +}
defctor.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: warning1.C =================================================================== --- warning1.C (nonexistent) +++ warning1.C (revision 338) @@ -0,0 +1,7 @@ +// { dg-do assemble } +// Bug: g++ protests that foo was never defined. + +static void foo (); +static void foo (); +static void foo () { } +void bar () { foo(); } // { dg-bogus "" }
warning1.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: access6.C =================================================================== --- access6.C (nonexistent) +++ access6.C (revision 338) @@ -0,0 +1,12 @@ +// { dg-do assemble } +// Simple testcase for access control. + +class A { + public: + void f (); +}; + +class B: protected A { }; +class C: protected B { + void g() { f (); } +};
access6.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: template39.C =================================================================== --- template39.C (nonexistent) +++ template39.C (revision 338) @@ -0,0 +1,22 @@ +// { dg-do assemble } +// PRMS Id: 10283 + +template struct B { + static void (*p)(); + static void f (); +}; + +template +void (*B::p)() = &B::f; + +B b; + +template struct A { + static const int j = i; + int k[j]; +}; + +A<1> a; + +template +const int A::j;
template39.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: crash9.C =================================================================== --- crash9.C (nonexistent) +++ crash9.C (revision 338) @@ -0,0 +1,29 @@ +// { dg-do assemble } +// PRMS Id: 5085 +// Bug: TYPE_POINTER_TO wasn't set. + +class A { + A(const A &); + void operator=(const A &); +public: + inline A(); +}; + +class B { + A a; +public: + B(); + virtual void f() const; +}; + +class C : public B { }; + +class D : C { +public: + void f() const; +}; + +void D::f() const +{ + C::f(); +}
crash9.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property Index: enum8.C =================================================================== --- enum8.C (nonexistent) +++ enum8.C (revision 338) @@ -0,0 +1,21 @@ +// { dg-do run } +// Bug: the switch fails on the Alpha because folding ef - 1 fails. + +enum foo { one=1, thirty=30 }; + +int f (enum foo ef) +{ + switch (ef) + { + case one: + case thirty: + return 0; + default: + return 1; + } +} + +int main () +{ + return f (one); +}
enum8.C Property changes : Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:keywords ## -0,0 +1 ## +Id \ No newline at end of property

powered by: WebSVN 2.1.0

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