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