cmp_clang_ttp_passing.cpp 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /*-----------------------------------------------------------------------------+
  2. Copyright (c) 2011-2011: Joachim Faulhaber
  3. +------------------------------------------------------------------------------+
  4. Distributed under the Boost Software License, Version 1.0.
  5. (See accompanying file LICENCE.txt or copy at
  6. http://www.boost.org/LICENSE_1_0.txt)
  7. +-----------------------------------------------------------------------------*/
  8. #define BOOST_TEST_MODULE icl::cmp_clang_ttp_passing unit test
  9. #include <libs/icl/test/disable_test_warnings.hpp>
  10. #include <boost/config.hpp>
  11. #include "../unit_test_unwarned.hpp"
  12. namespace sep
  13. {
  14. template<class T>class less{};
  15. template
  16. <
  17. class T,
  18. template<class>class Less = sep::less
  19. >
  20. class interv
  21. {
  22. public:
  23. typedef interv<T,Less> type;
  24. };
  25. template
  26. <
  27. class T,
  28. template<class>class Less = sep::less,
  29. class I = typename sep::interv<T,Less>::type
  30. >
  31. class cont
  32. {
  33. public:
  34. bool test()const { return true; }
  35. };
  36. }//namespace sep
  37. template
  38. <
  39. template
  40. <
  41. class _T,
  42. template<class>class _Less = sep::less,
  43. class I = typename sep::interv<_T,_Less>::type
  44. >
  45. class Cont,
  46. class T
  47. >
  48. bool test_ttp()
  49. {
  50. typedef Cont<T> cont_type;
  51. cont_type test_cont;
  52. return test_cont.test();
  53. };
  54. BOOST_AUTO_TEST_CASE(dummy)
  55. {
  56. bool result = test_ttp<sep::cont, int>();
  57. BOOST_CHECK( result );
  58. }