2 // Contributed by Martin Loewis <loewis at informatik dot hu-berlin dot de>
3 // PR c++/8856: Make sure template conversion operators are not parsed as
7 template <bool> struct K2 {};
9 template <class T> struct A {
10 template <class U> operator U() { return U(); }
16 (void)a.operator int();
17 (void)a.operator double();
18 (void)a.operator K2<true>();
19 (void)a.A<double>::operator int();
20 (void)a.A<double>::operator double();
21 (void)a.A<double>::operator K2<true>();
23 (void)a.operator double<int>(); // { dg-error "not a template" }
24 (void)a.operator K<int>(); // { dg-error "not a template" }
25 (void)a.A<double>::operator double<int>(); // { dg-error "not a template" }
26 (void)a.A<double>::operator K<int>(); // { dg-error "not a template" }