repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* auto-profile.c (afdo_annotate_cfg): Use update_max_bb_count.
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.other
/
call1.C
blob
e12cffedf4f6ebc86f17bf7ce8d8e49ecbebe6f9
1
// { dg-do run }
2
// Test that various calls to non-functions work.
3
4
void f () { }
5
6
typedef void (*fptr)();
7
typedef void (&fref)();
8
fptr p = f;
9
fref r = f;
10
const fptr &pr = p;
11
12
struct A {
13
fptr p;
14
15
A (fptr n): p(n) { }
16
operator fptr () { return p; }
17
};
18
19
struct B {
20
fref r;
21
22
B (fptr n): r(*n) { }
23
operator const fref () { return r; }
24
};
25
26
struct C {
27
const fptr pr;
28
29
C (fptr n): pr(n) { }
30
operator const fptr& () { return pr; }
31
};
32
33
int main ()
34
{
35
f();
36
37
p();
38
r();
39
pr();
40
41
A a (f);
42
a();
43
a.p();
44
45
B b (f);
46
b();
47
b.r();
48
49
C c (f);
50
c();
51
c.pr();
52
}