summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p10769b.C
blob: 9210a452ad6f7acece67cac1a89c96eeaee3c2fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// { dg-do assemble  }
// { dg-options "" }
// prms-id: 10769

#define PMF2PF(PMF) ((void (*)())(PMF))

class A {
public:
  void f1a() { }
  void main();
} a;

class B {
public:
  void bf1() { }
} b;

void A::main() {
  void (B::*mPtrB)(B*);
  (*(void (*)(A*))PMF2PF(mPtrB))(&b);	// { dg-error "argument passing" } 
  // { dg-warning "convert" "warn" { target *-*-* } 20 }
}

int main() {
  void (A::*mPtr)() = &A::f1a;
  (*(void (*)(A*))PMF2PF(mPtr))(&a);	// { dg-warning "convert" } 
}