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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [arm12.C] - Rev 823

Go to most recent revision | Compare with Previous | Blame | View Log

// { dg-do assemble  }
// GROUPS passed ARM-compliance
// arm file
// From: belley@cae.ca (Benoit Belley 3218)
// Subject: Bad access control with private constructor and derivation
// Date: Fri, 28 May 1993 12:39:57 -0400 (EDT)

#include <iostream>

class X
{
public:
  void f();

private:
  X();
};

class Y : public X
{
public:
  Y();
};

X::X() // { dg-error "is private" }
{
  std::cout << "X::X()" << std::endl;
}

void X::f()
{
  std::cout << "X::f()" << std::endl;
}

Y::Y() // { dg-error "within this context" }
{
  std::cout << "Y::Y()" << std::endl;
}


int main()
{
  Y y;
  y.f();
}




Go to most recent revision | Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

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