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++.mike/] [net8.C] - Rev 154

Compare with Previous | Blame | View Log

// { dg-do assemble  }
// { dg-options "-pedantic-errors" }

class Base {
public:
  int foo;
};

class Derived : public Base {
public:
  int bar;
};

void func(Base&);                       // { dg-error "passing argument 1" } 

void func2(const Derived& d) {
  func(d);                              // { dg-error "invalid initialization" }
}

void
foo (int& a)                            // { dg-error "in passing argument 1" } 
{
}

int main ()
{
  int b;
  const int*const a = &b;
  *a = 10;                              // { dg-error "read-only location" }
  foo (*a);                             // { dg-error "invalid initialization" }
  return 0;
}

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.