gcc/testsuite/g++.dg/torture/pr50672.C
raw| 1 | // { dg-do compile } |
| 2 | |
| 3 | struct A |
| 4 | { |
| 5 | bool isHint(); |
| 6 | }; |
| 7 | class B |
| 8 | { |
| 9 | void makeLine( int *) const; |
| 10 | void drawLine() const; A* to() const; |
| 11 | void _print() const; |
| 12 | }; |
| 13 | A a; |
| 14 | void B::makeLine(int *p1) const |
| 15 | { |
| 16 | if (a.isHint() && to()->isHint()) ; |
| 17 | else { |
| 18 | if (p1) B::drawLine(); else B::_print(); |
| 19 | return; |
| 20 | } |
| 21 | if (p1) B::drawLine(); else B::_print(); |
| 22 | } |