FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.benjamin / tem05.C
blob0523f1fe31bed5aee8e1fde58dcaf5dfb4bb28c7
1 // 980924 bkoz
2 // just a quick test for export, to make sure we are warning for it.
3 // CHANGE ME when it's supported
4 // Build don't link: 
7 // 14 Templates
8 //p 6
9 // A namespace-scope declaration or definintion of a non-line function
10 // template, a non-inline member function template, a non-inline
11 // member function of a class template or a static data member of a
12 // class template may be preceeded by the export keyword. If such a
13 // template is defined in the same translation unit in which it is
14 // declared as exported, the definition is considered to be
15 // exported. The first declaration of the template containing the
16 // export keyword must not follow the definition. (meaning that export
17 // can't beredeclared as non-export??)
19 // 1
20 // template definition
21 export template <class T>  // WARNING - 
22 bool templ_one(T a) {
23    if (a > 0)
24      return true;
25    else
26      return false;
30 // 2
31 // static data, mf, mf template
32 template <class T>
33 class X_one {
34   unsigned short        id;
35   T     type;
36 public:
37   static const bool     is_specialized ;
39   X_one(const unsigned short& us = 5): id(us), type(T(0)) {}
40   unsigned short ret_id ();
41   template <class T2> bool compare_ge(T2 test);
44 export template <class T> // WARNING - 
45 const bool X_one<T>::is_specialized = false;
47 export template <class T> // WARNING - 
48 unsigned short X_one<T>::ret_id() {
49   return id;
52 export template <class T2> // WARNING - 
53 bool compare_ge(T2 test) {
54   if (test > type) // ERROR - .*
55     return true;
56   return false;