This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

eb43


There should be no conditionals in test cases. This one tests for
various overload and template instantiation versions. I'm not sure
which ones are OK and which aren't.

Martin

Index: eb43.C
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/testsuite/g++.old-deja/g++.robertl/eb43.C,v
retrieving revision 1.1
diff -c -p -r1.1 eb43.C
*** eb43.C	1998/05/27 23:00:36	1.1
--- eb43.C	1998/05/30 12:33:58
*************** Expr(){};
*** 8,48 ****
  Expr(const T&){};
  };
  
- #ifdef TEMPLATE
  template <class T >
  inline bool compare(const Expr<T> a, const Expr<T> b){ return true; };
- #else
- inline bool compare(const Expr<int> a, const Expr<int> b){ return true; };
- #endif
  
  void main()
  {
    vector<int>	a(3);
- #if TEMPLATE == 1
    sort( a.begin(), a.end(),
  	static_cast<bool (*)(const Expr<int>,const Expr<int>)>(compare) );
- #elif TEMPLATE == 2
    sort( a.begin(), a.end(), compare<int> );
- #elif TEMPLATE == 3
    sort<vector<int>::iterator,
         pointer_to_binary_function<const Expr<int>, const Expr<int>, bool> >
      ( a.begin(), a.end(), compare );
- #elif TEMPLATE == 4
    sort( a.begin(), a.end(),
  	ptr_fun<const Expr<int>, const Expr<int>, bool> (compare) );
- #elif TEMPLATE == 5
    sort( a.begin(), a.end(),
  	ptr_fun(compare<int>) );
- #elif TEMPLATE == 6
    sort( a.begin(), a.end(),
  	pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare) );
- #elif TEMPLATE == 7
    sort( a.begin(), a.end(),
  	pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare<int>) );
- #elif TEMPLATE == 8
    sort( a.begin(), a.end(),
  	pointer_to_binary_function<const Expr<int>, const Expr<int>, bool>(compare<>) );
- #else
-   sort( a.begin(), a.end(), compare );
- #endif
  }
--- 8,33 ----


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]