gcc/testsuite/g++.dg/opt/pr104880.C
raw| 1 | // { dg-do compile } |
| 2 | // { dg-options "-O2 -Wno-pmf-conversions -fno-checking" } |
| 3 | |
| 4 | class c { |
| 5 | long b; |
| 6 | }; |
| 7 | class B { |
| 8 | public: |
| 9 | typedef void *d; |
| 10 | }; |
| 11 | class aa { |
| 12 | public: |
| 13 | aa(B::d); |
| 14 | }; |
| 15 | class e : public B { |
| 16 | public: |
| 17 | e(); |
| 18 | }; |
| 19 | unsigned int f; |
| 20 | struct g { |
| 21 | struct h : c { |
| 22 | h(unsigned int &i) : c(reinterpret_cast<c &>(i)) {} |
| 23 | unsigned int ad(); |
| 24 | }; |
| 25 | }; |
| 26 | class n : g { |
| 27 | public: |
| 28 | n(int); |
| 29 | void j() { |
| 30 | unsigned int a; |
| 31 | h k(a); |
| 32 | __atomic_compare_exchange_n(&f, &a, k.ad(), true, 3, 0); |
| 33 | } |
| 34 | }; |
| 35 | int l; |
| 36 | class m : e { |
| 37 | void ar() { |
| 38 | n b(l); |
| 39 | b.j(); |
| 40 | } |
| 41 | virtual void bd() { aa(d(&m::ar)); } |
| 42 | }; |
| 43 | void o() { new m; } |