2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.robertl / eb118.C
blob723e85333464491210bc9aa10f6aef07fa5cd734
1 // { dg-do run  }
2 // { dg-options "" }
3 // Test for obsolete specialization syntax.  Turn off -pedantic.
5 #include <iostream>
6 #include <typeinfo>
8 template <typename T>
9 class A {
10 public:
11   void test ();
14 template <typename T>
15 void
16 A<T>::test(){
17   std::cerr << "test for " << typeid(*this).name() << std::endl;
19 // Specialization declaration
20 template <> 
21 void                           
22 A<double>::test();
24 // Specialization definition
25 void
26 A<double>::test(){
27   std::cerr << "specialization for " << typeid(*this).name() << std::endl;
31 int
32 main(){
33   A<int> ai;
34   A<double> ad;
35   ai.test();
36   ad.test();
37   return 0;