// { dg-do run } // Copyright (C) 2001 Free Software Foundation, Inc. // Contributed by Nathan Sidwell 29 Dec 2001 // PR 4361. Template conversion operators were not overloaded. template struct C { operator T () { return 0; } template operator T2 () { return 1; } int Foo () { return operator T (); } template int Baz () { return static_cast (operator T2 ()); } }; int main () { int r; C c; r = c.Foo (); if (r) return 1; r = c.Baz (); if (r) return 2; r = c.Baz (); if (!r) return 3; return 0; }