Advertisement
Guest User

Untitled

a guest
Nov 26th, 2014
28
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 4.85 KB | None | 0 0
  1. $ cat testcase.best
  2. typedef int size_t;
  3. template <typename...> struct typelist;
  4. template <typename Type> Type &&declval();
  5. template <typename Type, Type...> struct integer_sequence {};
  6. template <typename...> class tuple {};
  7.  
  8. template <size_t, class> class tuple_element;
  9. template <typename Head, typename... Tail>
  10. struct tuple_element<0, tuple<Head, Tail...> > {
  11.   typedef Head type;
  12. };
  13. template <typename... Elements> tuple<Elements...> make_tuple(Elements...);
  14. template <typename Functor, typename... Args>
  15. int invoke(Functor functor,
  16.            Args &&... args) noexcept(noexcept(functor(args...)));
  17. template <typename...> struct result;
  18. template <typename Functor, typename Tuple, int... Indices,
  19.           typename = decltype(invoke(
  20.               declval<Functor>(),
  21.               declval<typename tuple_element<Indices, Tuple>::type>()...))>
  22. typename result<typename tuple_element<Indices, Tuple>::type...>::type
  23. uncurry(Functor, Tuple, integer_sequence<int, Indices...>);
  24. template <int, typename... Tuples>
  25. tuple<typename tuple_element<0, Tuples>::type...> slice_many(Tuples...);
  26. template <
  27.     int... ElementIndices, typename Functor, typename... Tuples,
  28.     typename = typelist<decltype(uncurry(
  29.         declval<Functor>(), slice_many<ElementIndices>(declval<Tuples>()...),
  30.         integer_sequence<int, 0, 0>()))...> >
  31. void zip_with(Functor, Tuples...);
  32. struct plus_assign {
  33.   template <typename Lhs, typename Rhs>
  34.   constexpr int operator()(Lhs &&lhs, Rhs &&rhs) {
  35.     lhs = 0;
  36.   }
  37. };
  38. auto rvalues = make_tuple(0);
  39. auto incr = zip_with<0>(plus_assign{}, rvalues)
  40. $ g++-trunk -x c++ -std=c++14 testcase.best
  41. testcase.best: In instantiation of 'int invoke(Functor, Args&& ...) [with Functor = plus_assign; Args = {int, int}]':
  42. testcase.best:18:37:   required by substitution of 'template<class Functor, class Tuple, int ...Indices, class> typename result<typename tuple_element<Indices, Tuple>::type ...>::type uncurry(Functor, Tuple, integer_sequence<int, Indices ...>) [with Functor = plus_assign; Tuple = tuple<int>; int ...Indices = {0, 0}; <template-parameter-1-4> = <missing>]'
  43. testcase.best:27:41:   required by substitution of 'template<int ...ElementIndices, class Functor, class ... Tuples, class> void zip_with(Functor, Tuples ...) [with int ...ElementIndices = 0; Functor = plus_assign; Tuples = {tuple<int>}; <template-parameter-1-4> = <missing>]'
  44. testcase.best:38:47:   required from here
  45. testcase.best:15:54:   in constexpr expansion of 'functor.plus_assign::operator()<int&, int&>((* & args#0), (* & args#1))'
  46. testcase.best:14:5: internal compiler error: in cxx_eval_store_expression, at cp/constexpr.c:2492
  47.  int invoke(Functor functor,
  48.      ^
  49. 0x6d9fdd cxx_eval_store_expression
  50.     ../../gcc/gcc/cp/constexpr.c:2492
  51. 0x6d7916 cxx_eval_constant_expression
  52.     ../../gcc/gcc/cp/constexpr.c:2961
  53. 0x6d7653 cxx_eval_constant_expression
  54.     ../../gcc/gcc/cp/constexpr.c:3192
  55. 0x6d795c cxx_eval_constant_expression
  56.     ../../gcc/gcc/cp/constexpr.c:3066
  57. 0x6d795c cxx_eval_constant_expression
  58.     ../../gcc/gcc/cp/constexpr.c:3066
  59. 0x6d7173 cxx_eval_call_expression
  60.     ../../gcc/gcc/cp/constexpr.c:1335
  61. 0x6d8018 cxx_eval_constant_expression
  62.     ../../gcc/gcc/cp/constexpr.c:2877
  63. 0x6d9857 is_sub_constant_expr(tree_node*)
  64.     ../../gcc/gcc/cp/constexpr.c:3436
  65. 0x67e92d check_noexcept_r
  66.     ../../gcc/gcc/cp/except.c:1168
  67. 0xc5b6e4 walk_tree_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*))
  68.     ../../gcc/gcc/tree.c:11022
  69. 0xc5ce08 walk_tree_without_duplicates_1(tree_node**, tree_node* (*)(tree_node**, int*, void*), void*, tree_node* (*)(tree_node**, int*, tree_node* (*)(tree_node**, int*, void*), void*, hash_set<tree_node*, default_hashset_traits>*))
  70.     ../../gcc/gcc/tree.c:11335
  71. 0x67e64f expr_noexcept_p(tree_node*, int)
  72.     ../../gcc/gcc/cp/except.c:1245
  73. 0x67e7b2 finish_noexcept_expr(tree_node*, int)
  74.     ../../gcc/gcc/cp/except.c:1230
  75. 0x5f7f48 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
  76.     ../../gcc/gcc/cp/pt.c:14832
  77. 0x61154d maybe_instantiate_noexcept(tree_node*)
  78.     ../../gcc/gcc/cp/pt.c:19899
  79. 0x62c01f mark_used(tree_node*, int)
  80.     ../../gcc/gcc/cp/decl2.c:4879
  81. 0x5c6079 build_over_call
  82.     ../../gcc/gcc/cp/call.c:7434
  83. 0x5cee51 build_new_function_call(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, int)
  84.     ../../gcc/gcc/cp/call.c:4081
  85. 0x693cf9 finish_call_expr(tree_node*, vec<tree_node*, va_gc, vl_embed>**, bool, bool, int)
  86.     ../../gcc/gcc/cp/semantics.c:2392
  87. 0x5f9595 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool, bool)
  88.     ../../gcc/gcc/cp/pt.c:15148
  89. Please submit a full bug report,
  90. with preprocessed source if appropriate.
  91. Please include the complete backtrace with any bug report.
  92. See <http://gcc.gnu.org/bugs.html> for instructions.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement