summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/opt/pr104880.C
blob: de56a5acfd43631ed4839d2e47dd71f2980b1363 (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// { dg-do compile }
// { dg-options "-O2 -Wno-pmf-conversions -fno-checking" }

class c {
  long b;
};
class B {
public:
  typedef void *d;
};
class aa {
public:
  aa(B::d);
};
class e : public B {
public:
  e();
};
unsigned int f;
struct g {
  struct h : c {
    h(unsigned int &i) : c(reinterpret_cast<c &>(i)) {}
    unsigned int ad();
  };
};
class n : g {
public:
  n(int);
  void j() {
    unsigned int a;
    h k(a);
    __atomic_compare_exchange_n(&f, &a, k.ad(), true, 3, 0);
  }
};
int l;
class m : e {
  void ar() {
    n b(l);
    b.j();
  }
  virtual void bd() { aa(d(&m::ar)); }
};
void o() { new m; }