Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: invalid operands to binary expression ('const yngtab::filled_tableau<unsigned int>::in_column_iterator' and 'difference_type' (aka 'long')) #285

Open
yurivict opened this issue Dec 17, 2023 · 0 comments

Comments

@yurivict
Copy link
Contributor

clang-17 fails to compile cadabra:

In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/algorithms/indexsort.cc:2:
In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./IndexIterator.hh:4:
In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./Storage.hh:24:
In file included from /usr/include/c++/v1/iostream:43:
In file included from /usr/include/c++/v1/ios:222:
In file included from /usr/include/c++/v1/__locale:21:
In file included from /usr/include/c++/v1/mutex:192:
In file included from /usr/include/c++/v1/__condition_variable/condition_variable.h:17:
In file included from /usr/include/c++/v1/__mutex/unique_lock.h:17:
In file included from /usr/include/c++/v1/__system_error/system_error.h:14:
In file included from /usr/include/c++/v1/__system_error/error_category.h:15:
In file included from /usr/include/c++/v1/string:622:
In file included from /usr/include/c++/v1/string_view:1059:
In file included from /usr/include/c++/v1/algorithm:1803:
In file included from /usr/include/c++/v1/__algorithm/nth_element.h:15:
/usr/include/c++/v1/__algorithm/sort.h:289:52: error: invalid operands to binary expression ('const yngtab::filled_tableau<unsigned int>::in_column_iterator' and 'difference_type' (aka 'long'))
  289 |   const _RandomAccessIterator __leftmost = __first - difference_type(1); (void)__leftmost; // can be unused when assertions are disabled
      |                                            ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__algorithm/sort.h:759:14: note: in instantiation of function template specialization 'std::__insertion_sort_unguarded<std::_ClassicAlgPolicy, cadabra::indexsort::less_indexed_treenode &, yngtab::filled_tableau<unsigned int>::in_column_iterator>' requested here
  759 |         std::__insertion_sort_unguarded<_AlgPolicy, _Compare>(__first, __last, __comp);
      |              ^
/usr/include/c++/v1/__algorithm/sort.h:878:8: note: in instantiation of function template specialization 'std::__introsort<std::_ClassicAlgPolicy, cadabra::indexsort::less_indexed_treenode &, yngtab::filled_tableau<unsigned int>::in_column_iterator, false>' requested here
  878 |   std::__introsort<_AlgPolicy,
      |        ^
/usr/include/c++/v1/__algorithm/sort.h:946:10: note: in instantiation of function template specialization 'std::__sort_dispatch<std::_ClassicAlgPolicy, yngtab::filled_tableau<unsigned int>::in_column_iterator, cadabra::indexsort::less_indexed_treenode>' requested here
  946 |     std::__sort_dispatch<_AlgPolicy>(std::__unwrap_iter(__first), std::__unwrap_iter(__last), __comp);
      |          ^
/usr/include/c++/v1/__algorithm/sort.h:954:8: note: in instantiation of function template specialization 'std::__sort_impl<std::_ClassicAlgPolicy, yngtab::filled_tableau<unsigned int>::in_column_iterator, cadabra::indexsort::less_indexed_treenode>' requested here
  954 |   std::__sort_impl<_ClassicAlgPolicy>(std::move(__first), std::move(__last), __comp);
      |        ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./YoungTab.hh:497:9: note: in instantiation of function template specialization 'std::sort<yngtab::filled_tableau<unsigned int>::in_column_iterator, cadabra::indexsort::less_indexed_treenode>' requested here
  497 |                         std::sort(begin_column(c), end_column(c), comp);
      |                              ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./YoungTab.hh:521:4: note: in instantiation of function template specialization 'yngtab::filled_tableau<unsigned int>::sort_within_columns<cadabra::indexsort::less_indexed_treenode>' requested here
  521 |                         sort_within_columns(comp);
      |                         ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/algorithms/indexsort.cc:45:10: note: in instantiation of function template specialization 'yngtab::filled_tableau<unsigned int>::canonicalise<cadabra::indexsort::less_indexed_treenode>' requested here
   45 |                 tmptab.canonicalise(comp, false); // KP: why is this here? tb->only_column_exchange());
      |                        ^
/usr/include/c++/v1/__ios/fpos.h:61:11: note: candidate template ignored: could not match 'const fpos<_StateT>' against 'const yngtab::filled_tableau<unsigned int>::in_column_iterator'
   61 | streamoff operator-(const fpos<_StateT>& __x, const fpos<_StateT>& __y) {
      |           ^
/usr/include/c++/v1/__iterator/reverse_iterator.h:298:1: note: candidate template ignored: could not match 'const reverse_iterator<_Iter1>' against 'const yngtab::filled_tableau<unsigned int>::in_column_iterator'
  298 | operator-(const reverse_iterator<_Iter1>& __x, const reverse_iterator<_Iter2>& __y)
      | ^
/usr/include/c++/v1/__iterator/wrap_iter.h:194:6: note: candidate template ignored: could not match 'const __wrap_iter<_Iter1>' against 'const yngtab::filled_tableau<unsigned int>::in_column_iterator'
  194 | auto operator-(const __wrap_iter<_Iter1>& __x, const __wrap_iter<_Iter2>& __y) _NOEXCEPT
      |      ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./YoungTab.hh:157:26: note: candidate function not viable: 'this' argument has type 'const yngtab::filled_tableau<unsigned int>::in_column_iterator', but method is not marked const
  157 |                                         in_column_iterator  operator-(unsigned int);
      |                                                             ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./YoungTab.hh:165:26: note: candidate function not viable: no known conversion from 'difference_type' (aka 'long') to 'const in_column_iterator' for 1st argument
  165 |                                         ptrdiff_t           operator-(const in_column_iterator&) const;
      |                                                             ^         ~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/algorithms/indexsort.cc:2:
In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./IndexIterator.hh:4:
In file included from /wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./Storage.hh:24:
In file included from /usr/include/c++/v1/iostream:43:
In file included from /usr/include/c++/v1/ios:222:
In file included from /usr/include/c++/v1/__locale:21:
In file included from /usr/include/c++/v1/mutex:192:
In file included from /usr/include/c++/v1/__condition_variable/condition_variable.h:17:
In file included from /usr/include/c++/v1/__mutex/unique_lock.h:17:
In file included from /usr/include/c++/v1/__system_error/system_error.h:14:
In file included from /usr/include/c++/v1/__system_error/error_category.h:15:
In file included from /usr/include/c++/v1/string:622:
In file included from /usr/include/c++/v1/string_view:1059:
In file included from /usr/include/c++/v1/algorithm:1803:
In file included from /usr/include/c++/v1/__algorithm/nth_element.h:15:
/usr/include/c++/v1/__algorithm/sort.h:290:44: error: invalid operands to binary expression ('const yngtab::filled_tableau<unsigned int>::in_column_iterator' and 'difference_type' (aka 'long'))
  290 |   for (_RandomAccessIterator __i = __first + difference_type(1); __i != __last; ++__i) {
      |                                    ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~
/usr/include/c++/v1/__iterator/reverse_iterator.h:316:1: note: candidate template ignored: could not match 'reverse_iterator<_Iter>' against 'difference_type' (aka 'long')
  316 | operator+(typename reverse_iterator<_Iter>::difference_type __n, const reverse_iterator<_Iter>& __x)
      | ^
/usr/include/c++/v1/__iterator/wrap_iter.h:206:21: note: candidate template ignored: could not match '__wrap_iter<_Iter1>' against 'difference_type' (aka 'long')
  206 | __wrap_iter<_Iter1> operator+(typename __wrap_iter<_Iter1>::difference_type __n, __wrap_iter<_Iter1> __x) _NOEXCEPT
      |                     ^
/wrkdirs/usr/ports/math/cadabra2/work/cadabra2-2.4.4.1/core/./YoungTab.hh:156:26: note: candidate function not viable: 'this' argument has type 'const yngtab::filled_tableau<unsigned int>::in_column_iterator', but method is not marked const
  156 |                                         in_column_iterator  operator+(unsigned int);
      |                                                             ^
2 errors generated.

cadabra2-2.4.4.1
clang-17
FreeBSD 15 CURRENT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant