Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / gcc / testsuite / g++.dg / parse / casting-operator2.C
blob008fa62dc74b78ad5868e5a3dc49b7ec556b23f2
1 // { dg-do compile }
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
4 //   template names.
6 struct K {};
7 template <bool> struct K2 {};
9 template <class T> struct A {
10   template <class U> operator U() { return U(); }
13 int main() {
14   A<double> a;
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" }