summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/conversion/ptrmem9.C
blob: d4a260f92731ed17a1ccfc6567338a919d215e89 (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
// Copyright (C) 2007 Free Software Foundation
// Contributed by Ollie Wild <aaw@google.com>
// { dg-do compile }

// Test implicit conversion of pointers to member functions appearing as
// operands of the equality operators.

struct B { };

struct BV { };

struct D : B, virtual BV { };

struct C { };

void f ()
{
  void (D::*pd) () = 0;
  void (B::*pb) () = 0;
  void (BV::*pbv) () = 0;
  void (C::*pc) () = 0;

  pd == pb;
  pd == pbv;  // { dg-error "" }
  pd == pc;   // { dg-error "comparison between distinct pointer-to-member types" }
}