19 template<int I> void f1()
22 A::template a1(); // { dg-error "template" }
24 p->template a1(); // { dg-error "template" }
27 A::template B<0>::b1();
28 A::template B<0>::template b1(); // { dg-error "template" }
29 A::template B<0>::template b2(0);
30 A::template B<0>::template b2<double>(0);
32 // Because B<I> is dependent, none of these are errors, as this
33 // function is not instantiated.
34 A::template B<I>::b1();
35 A::template B<I>::template b1();
36 A::template B<I>::template b2(0);
37 A::template B<I>::template b2<double>(0);
39 A::template C::c1(); // { dg-error "template" }
42 template<int I> void f2()
44 // These are copies of lines from f1, but this function is
45 // instantiated, so we should get errors here.
46 A::template B<I>::b1();
47 A::template B<I>::template b1(); // { dg-error "template" }
48 A::template B<I>::template b2(0);
49 A::template B<I>::template b2<double>(0);
52 template void f2<0>(); // { dg-error "instantiated" }