1// { dg-do assemble  }
2// Copyright (C) 2000, 2002 Free Software Foundation, Inc.
3// Contributed by Nathan Sidwell 14 Nov 2000 <nathan@codesourcery.com>
4
5// bug 616. We failed to complete the type of decls in templates, leading to
6// bogus errors.
7
8struct Z;
9struct Y
10{
11  Y (int i = 1);
12};
13void g ()
14{
15  const Y y;
16  Z z;          // { dg-error "" } incomplete
17}
18
19template <int dim>
20struct X
21{
22  X (int i=1);
23};
24
25void h ()
26{
27  const X<2> z;
28  Z z1;         // { dg-error "" } incomplete
29}
30
31template <int dim>
32void f()
33{
34  const X<dim> x;
35  const X<dim+1> y[3];
36  Z z2;           // { dg-error "" } incomplete
37  typedef Z z3;   // ok
38}
39
40template void f<3> ();
41