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

Subversion Repositories openrisc

[/] [openrisc/] [trunk/] [gnu-old/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.dg/] [template/] [mem_func_ptr.C] - Blame information for rev 853

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

Line No. Rev Author Line
1 149 jeremybenn
// { dg-do compile }
2
template struct takes_member_ptr;
3
template struct takes_member_ptr {};
4
 
5
template
6
void fun_takes_member_ptr(T Klasse::*) {}
7
 
8
 
9
template struct order_member_ptrs;
10
template struct order_member_ptrs {};
11
template
12
  struct order_member_ptrs
13
  {
14
    typedef int type;
15
  };
16
 
17
template
18
  struct order_member_ptrs
19
  {
20
    typedef int c_type;
21
  };
22
 
23
template
24
  struct order_member_ptrs
25
  {
26
    typedef int v_type;
27
  };
28
 
29
template
30
  struct order_member_ptrs
31
  {
32
    typedef int cv_type;
33
  };
34
 
35
 
36
struct X {
37
  void bar(float) {}
38
  void bar_c(float) const {}
39
  void bar_v(float) volatile {}
40
  void bar_cv(float) const volatile {}
41
};
42
 
43
void foo()
44
{
45
  sizeof(takes_member_ptr);
46
  sizeof(takes_member_ptr);
47
  sizeof(takes_member_ptr);
48
  sizeof(takes_member_ptr);
49
  sizeof(order_member_ptrs::type);
50
  sizeof(order_member_ptrs::c_type);
51
  sizeof(order_member_ptrs::v_type);
52
  sizeof(order_member_ptrs::cv_type);
53
  fun_takes_member_ptr(&X::bar);
54
  fun_takes_member_ptr(&X::bar_c);
55
  fun_takes_member_ptr(&X::bar_v);
56
  fun_takes_member_ptr(&X::bar_cv);
57
}

powered by: WebSVN 2.1.0

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