1// PR c++/8080
2
3// Bug: the transformation in finish_while_stmt_cond produced something
4// that tsubst_expr handled badly.  Fixed by not doing the transformation
5// while parsing a template.
6
7class TObject {};
8
9struct TIter {
10  TObject           *operator()();
11};
12
13
14template<class T>
15void get_root_object(TIter& iobj) {
16  while ( TObject* pnew_obj = iobj() )
17    ;
18}
19
20void foo(TIter& iobj)
21{
22  get_root_object<int>(iobj);
23}
24