summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/conv6.C
blob: 7a299553e7d1309b1bb01f6b5b385c44fff7b359 (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
28
29
// { dg-do run  }
// Test for composite pointer types, as defined in [expr.rel],
// and common pointer to member types, as defined in [expr.eq].

struct A { int i; };
struct B : public A { };

int main ()
{
  B b;

  // The composite type is `A const *'
        A* ap = &b;
  const B* bp = &b;
  if (ap != bp)		// { dg-bogus "" } distinct types
    return 1;

  // The composite type is `B const *const *'
  B       *const * p = 0;
  B const *      * q = 0;
  if (p != q)		// { dg-bogus "" } distinct types
    return 1;

  // The common type is `int const B::*'
  const int A::*apm = &A::i;
        int B::*bpm = &A::i;
  if (apm != bpm)	// { dg-bogus "" } distinct types
    return 1;
}