URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 305 |
Rev 338 |
// { dg-do assemble }
|
// { dg-do assemble }
|
// { dg-options "-pedantic-errors" }
|
// { dg-options "-pedantic-errors" }
|
|
|
class Base {
|
class Base {
|
public:
|
public:
|
int foo;
|
int foo;
|
};
|
};
|
|
|
class Derived : public Base {
|
class Derived : public Base {
|
public:
|
public:
|
int bar;
|
int bar;
|
};
|
};
|
|
|
void func(Base&); // { dg-error "passing argument 1" }
|
void func(Base&); // { dg-error "passing argument 1" }
|
|
|
void func2(const Derived& d) {
|
void func2(const Derived& d) {
|
func(d); // { dg-error "invalid initialization" }
|
func(d); // { dg-error "invalid initialization" }
|
}
|
}
|
|
|
void
|
void
|
foo (int& a) // { dg-error "in passing argument 1" }
|
foo (int& a) // { dg-error "in passing argument 1" }
|
{
|
{
|
}
|
}
|
|
|
int main ()
|
int main ()
|
{
|
{
|
int b;
|
int b;
|
const int*const a = &b;
|
const int*const a = &b;
|
*a = 10; // { dg-error "read-only location" }
|
*a = 10; // { dg-error "read-only location" }
|
foo (*a); // { dg-error "invalid initialization" }
|
foo (*a); // { dg-error "invalid initialization" }
|
return 0;
|
return 0;
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.