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++.dg/] [lookup/] [template1.C] - Diff between revs 149 and 154

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.
}
}
 
 

powered by: WebSVN 2.1.0

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