FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.dg / template / subst1.C
blob827af23d21e7ffde84f9b7f28f89a5a647382c91
1 // { dg-do compile }
3 // Copyright (C) 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
6 // PR 7718. ICE.
8 template <typename OBJECT>
9 void default_initializer(const OBJECT &) { }
12 template <typename OBJECT, void init_function(const OBJECT &)>
13 class cContainer {
14   public:
15   template <typename INITIALIZER>
16   void Add(const INITIALIZER &initializer) {
17     init_function(initializer);
18   }
21 int main() {
22   cContainer<int, default_initializer<int> > c;
23   
24   c.Add<int>(42);
25   
26   return 0;