OSDN Git Service

gcc:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / subst1.C
1 // { dg-do compile }
2
3 // Copyright (C) 2002 Free Software Foundation, Inc.
4 // Contributed by Nathan Sidwell 16 Sep 2002 <nathan@codesourcery.com>
5
6 // PR 7718. ICE.
7
8 template <typename OBJECT>
9 void default_initializer(const OBJECT &) { }
10
11
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   }
19 };
20
21 int main() {
22   cContainer<int, default_initializer<int> > c;
23   
24   c.Add<int>(42);
25   
26   return 0;
27 }