OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [gcc/] [testsuite/] [g++.dg/] [lookup/] [template1.C] - Blame information for rev 774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 693 jeremybenn
/* PR c++/3009 */
2
/* { dg-do run } */
3
// According to 14.6.2.4 of C++ Standard:
4
// "If a base class is a dependent type, a member of that
5
// class cannot hide a name declared within a template, or a
6
// name from the template's enclosing scopes."
7
 
8
class B {
9
public:
10
  int foo() { return 1; }
11
};
12
 
13
int foo() { return 0; }
14
 
15
template  class C : public T {
16
public:
17
  int caller() { return foo(); } // This must be ::foo, not B::foo.
18
};
19
 
20
int main() {
21
  C c;
22
  return c.caller(); // Returns 1 if we got the wrong one.
23
}

powered by: WebSVN 2.1.0

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