1 // { dg-do assemble  }
2 // { dg-options "-Wconversion" }
3 //
4 // Copyright (C) 2001 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 5 May 2001 <nathan@codesourcery.com>
6 
7 // Bug 2726. We ICE'd trying to say something about possibly confusing
8 // conversion overload resolution.
9 
10 class foo
11 {
12 };
13 
14 template<class T>
15 class bar
16 {
17 public:
18     operator const T&() const ;
19     operator T&() ;
20 
21 };
22 
23 
24 template<class T, class Ref, class NodePtr, class ListPtr>
25 class iterator_template
26 {
27 public:
28     iterator_template();
29     Ref operator*() const;
30 
31 };
32 
33 struct IdlDeclarator
34 {
35 };
36 
37 typedef bar< IdlDeclarator > IdlDeclarator_bar;
38 int
yyparse()39 yyparse()
40 
41 {
42 
43   iterator_template<IdlDeclarator_bar,IdlDeclarator_bar&,foo*,foo*> declIter;
44   const IdlDeclarator& declarator = *declIter;
45   return 1;
46 }
47