gcc/testsuite/g++.dg/template/instantiate3.C
raw| 1 | // { dg-do compile } |
| 2 | // Origin: Scott Snyder <[email protected]> |
| 3 | |
| 4 | // PR c++/7639 |
| 5 | // ICE when accessing member with incomplete type. |
| 6 | |
| 7 | class ACE_Null_Mutex; // { dg-message "forward declaration" } |
| 8 | |
| 9 | template <class TYPE> |
| 10 | struct ACE_Cleanup_Adapter |
| 11 | { |
| 12 | TYPE &object () |
| 13 | { return object_; } |
| 14 | TYPE object_; // { dg-error "incomplete type" } |
| 15 | }; |
| 16 | |
| 17 | template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "required from here" } |