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