summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.robertl/eb118.C
blob: 23498c7855477ec9f05d25cbe7e837e448461743 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
// Test for obsolete specialization syntax.  Turn off -pedantic.
// Special g++ Options:

#include <iostream.h>
#include <typeinfo>

template <typename T>
class A {
public:
  void test ();
};

template <typename T>
void
A<T>::test(){
  cerr << "test for " << typeid(*this).name() << endl;
}
// Specialization declaration
void                           
A<double>::test();

// Specialization definition
void
A<double>::test(){
  cerr << "specialization for " << typeid(*this).name() << endl;
}


int
main(){
  A<int> ai;
  A<double> ad;
  ai.test();
  ad.test();
  return 0;
}