URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Go to most recent revision |
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
// { dg-do compile }
|
// { dg-do compile }
|
// Origin: Dirk Mueller
|
// Origin: Dirk Mueller
|
|
|
// PR c++/2739
|
// PR c++/2739
|
// Access to base class private static member.
|
// Access to base class private static member.
|
|
|
class Base {
|
class Base {
|
private:
|
private:
|
static int fooprivate;
|
static int fooprivate;
|
protected:
|
protected:
|
static int fooprotected;
|
static int fooprotected;
|
public:
|
public:
|
static int foopublic;
|
static int foopublic;
|
};
|
};
|
|
|
class Derived : public Base {
|
class Derived : public Base {
|
public:
|
public:
|
void test();
|
void test();
|
};
|
};
|
|
|
int Base::fooprivate=42; // { dg-error "private" }
|
int Base::fooprivate=42; // { dg-error "private" }
|
int Base::fooprotected=42;
|
int Base::fooprotected=42;
|
int Base::foopublic=42;
|
int Base::foopublic=42;
|
|
|
void Derived::test() {
|
void Derived::test() {
|
if ( fooprivate ); // { dg-error "context" }
|
if ( fooprivate ); // { dg-error "context" }
|
if ( fooprotected );
|
if ( fooprotected );
|
if ( foopublic );
|
if ( foopublic );
|
}
|
}
|
|
|
int main()
|
int main()
|
{
|
{
|
Derived d;
|
Derived d;
|
d.test();
|
d.test();
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.