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

Subversion Repositories openrisc_me

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.bugs/] [900428_03.C] - Diff between revs 149 and 154

Only display areas with differences | Details | Blame | View Log

Rev 149 Rev 154
// { dg-do assemble  }
// { dg-do assemble  }
// g++ 1.37.1 bug 900428_03
// g++ 1.37.1 bug 900428_03
// g++ fails to detect cases where a constructor for a derived class invokes
// g++ fails to detect cases where a constructor for a derived class invokes
// (either explicitly or implicitly) a private constructor for a base class.
// (either explicitly or implicitly) a private constructor for a base class.
// cfront 2.0 passes this test.
// cfront 2.0 passes this test.
// keywords: inheritance, private, accessability, constructors
// keywords: inheritance, private, accessability, constructors
struct struct_0 {
struct struct_0 {
  int struct_0_data_member;
  int struct_0_data_member;
private:
private:
  struct_0 (int, int);
  struct_0 (int, int);
public:
public:
  struct_0 (int);
  struct_0 (int);
};
};
struct_0::struct_0 (int i) { }
struct_0::struct_0 (int i) { }
struct_0::struct_0 (int, int) { } // { dg-error "is private" }
struct_0::struct_0 (int, int) { } // { dg-error "is private" }
struct struct_1 : public struct_0 {
struct struct_1 : public struct_0 {
  struct_1 ();
  struct_1 ();
};
};
struct_1::struct_1 () : struct_0 (8,9) // { dg-error "within this context" }
struct_1::struct_1 () : struct_0 (8,9) // { dg-error "within this context" }
{
{
}
}
struct struct_2 {
struct struct_2 {
  struct_0 struct_2_data_member;
  struct_0 struct_2_data_member;
  struct_2 ();
  struct_2 ();
};
};
struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-error "within this context" }
struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-error "within this context" }
{
{
}
}
int main () { return 0; }
int main () { return 0; }
 
 

powered by: WebSVN 2.1.0

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