gcc/testsuite/g++.dg/tree-ssa/pr93845.C
raw| 1 | /* { dg-do compile } */ |
| 2 | /* { dg-options "-O1" } */ |
| 3 | |
| 4 | struct g; |
| 5 | struct h { |
| 6 | g *operator->(); |
| 7 | }; |
| 8 | class i { |
| 9 | void *a; |
| 10 | int b; |
| 11 | |
| 12 | public: |
| 13 | template <typename f> f j() { return *static_cast<f *>(this); } |
| 14 | }; |
| 15 | struct k : i {}; |
| 16 | struct l : k {}; |
| 17 | struct m { |
| 18 | i n(); |
| 19 | i o(l, l, int); |
| 20 | }; |
| 21 | struct g { |
| 22 | void m_fn4(k); |
| 23 | }; |
| 24 | h a; |
| 25 | i b; |
| 26 | i m::n() { |
| 27 | l c, d, e = o(d, c, 0).j<l>(); |
| 28 | a->m_fn4(e); |
| 29 | return b; |
| 30 | } |