URL
https://opencores.org/ocsvn/openrisc_me/openrisc_me/trunk
Only display areas with differences |
Details |
Blame |
View Log
Rev 149 |
Rev 154 |
/* PR c++/3009 */
|
/* PR c++/3009 */
|
/* { dg-do run } */
|
/* { dg-do run } */
|
// According to 14.6.2.4 of C++ Standard:
|
// According to 14.6.2.4 of C++ Standard:
|
// "If a base class is a dependent type, a member of that
|
// "If a base class is a dependent type, a member of that
|
// class cannot hide a name declared within a template, or a
|
// class cannot hide a name declared within a template, or a
|
// name from the template's enclosing scopes."
|
// name from the template's enclosing scopes."
|
|
|
class B {
|
class B {
|
public:
|
public:
|
int foo() { return 1; }
|
int foo() { return 1; }
|
};
|
};
|
|
|
int foo() { return 0; }
|
int foo() { return 0; }
|
|
|
template class C : public T {
|
template class C : public T {
|
public:
|
public:
|
int caller() { return foo(); } // This must be ::foo, not B::foo.
|
int caller() { return foo(); } // This must be ::foo, not B::foo.
|
};
|
};
|
|
|
int main() {
|
int main() {
|
C c;
|
C c;
|
return c.caller(); // Returns 1 if we got the wrong one.
|
return c.caller(); // Returns 1 if we got the wrong one.
|
}
|
}
|
|
|
© copyright 1999-2024
OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.