OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.5.1/] [gcc/] [testsuite/] [g++.dg/] [template/] [overload5.C] - Blame information for rev 301

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 301 jeremybenn
// PR c++/22621
2
 
3
struct foo {
4
    typedef int (*fun)(int);
5
 
6
  static int f(int);    // overload between static & non-static
7
    int f();
8
 
9
  static int g(int);    // non-overloaded static
10
};
11
 
12
template
13
struct f_obj {
14
  // something ..
15
};
16
 
17
f_obj<&foo::f> a;   // OK
18
f_obj  b;   // OK (note: a and b are of the same type)
19
 
20
int foo::f()
21
{
22
  f_obj<&foo::f> a;   // OK
23
  f_obj  b;   // ERROR: foo::f cannot be a constant expression
24
 
25
  f_obj<&foo::g> c;   // OK
26
  f_obj  d;   // OK
27
}
28
 

powered by: WebSVN 2.1.0

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