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
* c-common.c (get_priority): Add check for
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.martin
/
pmf2.C
blob
e52ce9f61fa403accf3f2aa5c94a9d01dd1a51b2
1
// { dg-do run }
2
// { dg-options "-Wno-pmf-conversions" }
3
// Test conversion of pointers to virtual member functions to
4
// pointers to non-member functions.
5
6
struct A{
7
int i;
8
A () :i(1){}
9
virtual void foo();
10
}a;
11
12
void A::foo()
13
{
14
i = 0;
15
}
16
17
int main()
18
{
19
void (*f)(A*) = (void(*)(A*))(&A::foo);
20
f(&a);
21
return a.i;
22
}