1*c87b03e5Sespie // Build don't link:
2*c87b03e5Sespie //
3*c87b03e5Sespie // Copyright (C) 2000 Free Software Foundation, Inc.
4*c87b03e5Sespie // Contributed by Nathan Sidwell 19 Jan 2001 <nathan@codesourcery.com>
5*c87b03e5Sespie 
6*c87b03e5Sespie // Bug 1656. We failed to make sure that a template-id was built
7*c87b03e5Sespie // from a primary template.
8*c87b03e5Sespie 
9*c87b03e5Sespie template <int dim> struct Outer
10*c87b03e5Sespie {
11*c87b03e5Sespie   struct Inner {};
12*c87b03e5Sespie 
fOuter13*c87b03e5Sespie   void f()
14*c87b03e5Sespie   {
15*c87b03e5Sespie     Inner<dim> i;         // ERROR - non-template
16*c87b03e5Sespie     Inner<> j;            // ERROR - non-template
17*c87b03e5Sespie   }
18*c87b03e5Sespie };
19*c87b03e5Sespie struct O {};
foo()20*c87b03e5Sespie void foo ()
21*c87b03e5Sespie {
22*c87b03e5Sespie   Outer<1> x;
23*c87b03e5Sespie   x.f ();
24*c87b03e5Sespie   Outer<1>::Inner<2> z;   // ERROR - non-template
25*c87b03e5Sespie   O<1> w;                 // ERROR - non-template
26*c87b03e5Sespie }
27*c87b03e5Sespie 
28*c87b03e5Sespie template <typename T, template <typename C> class TPL>
29*c87b03e5Sespie struct X
30*c87b03e5Sespie {
31*c87b03e5Sespie   TPL<T> t;
32*c87b03e5Sespie   T<int> s;     // ERROR - non-template
33*c87b03e5Sespie };
34*c87b03e5Sespie 
35*c87b03e5Sespie template <typename T> struct Y
36*c87b03e5Sespie {
37*c87b03e5Sespie };
38*c87b03e5Sespie 
bar()39*c87b03e5Sespie void bar ()
40*c87b03e5Sespie {
41*c87b03e5Sespie   X<int, Y> a;
42*c87b03e5Sespie   X<int, O> b;  // ERROR - non-template
43*c87b03e5Sespie }
44