Wandbox
SettingsLog
SettingsLog
Language
GitHubLogin
Ran/Viewed Log

Author

anonymous

almost 4 years ago

Language

C++

Compiler

gcc HEAD 12.0.0 20210706 (experimental)

Options
Warnings
Boost 1.73.0
C++2b(GNU)
no pedantic

Author

anonymous

almost 4 years ago

$ g++ prog.cc -Wall -Wextra -I/opt/wandbox/boost-1.73.0/gcc-head/include -std=gnu++2b
prog.cc: In instantiation of 'auto remove_nulls(auto:19&) [with auto:19 = std::vector<std::optional<int> >]':
prog.cc:17:26:   required from here
prog.cc:8:28: error: no match for call to '(const std::ranges::__remove_fn) (std::vector<std::optional<int> >&, const std::nullopt_t&)'
    8 |  return std::ranges::remove(
      |         ~~~~~~~~~~~~~~~~~~~^
    9 |      range, std::nullopt);
      |      ~~~~~~~~~~~~~~~~~~~~   
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/algorithm:64,
                 from prog.cc:4:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_algo.h:1045:7: note: candidate: 'template<class _Iter, class _Sent, class _Tp, class _Proj>  requires (permutable<_Iter>) && (sentinel_for<_Sent, _Iter>) && (indirect_binary_predicate<std::ranges::equal_to, std::projected<_I1, _P1>, const _Tp*>) constexpr std::ranges::subrange<_Iter1> std::ranges::__remove_fn::operator()(_Iter, _Sent, const _Tp&, _Proj) const'
 1045 |       operator()(_Iter __first, _Sent __last,
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_algo.h:1045:7: note:   template argument deduction/substitution failed:
prog.cc:8:28: note:   candidate expects 4 arguments, 2 provided
    8 |  return std::ranges::remove(
      |         ~~~~~~~~~~~~~~~~~~~^
    9 |      range, std::nullopt);
      |      ~~~~~~~~~~~~~~~~~~~~   
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/algorithm:64,
                 from prog.cc:4:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_algo.h:1061:7: note: candidate: 'template<class _Range, class _Tp, class _Proj>  requires (forward_range<_Range>) && ((permutable<decltype(std::ranges::__cust_access::__begin((declval<_Container&>)()))>) && (indirect_binary_predicate<std::ranges::equal_to, std::projected<decltype(std::ranges::__cust_access::__begin((declval<_Container&>)())), _Proj>, const _Tp*>)) constexpr std::ranges::borrowed_subrange_t<_Range1> std::ranges::__remove_fn::operator()(_Range&&, const _Tp&, _Proj) const'
 1061 |       operator()(_Range&& __r, const _Tp& __value, _Proj __proj = {}) const
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_algo.h:1061:7: note:   template argument deduction/substitution failed:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_algo.h:1061:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/compare:39,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_pair.h:65,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_algobase.h:64,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/vector:60,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts: In substitution of 'template<class _Range, class _Tp, class _Proj>  requires (forward_range<_Range>) && ((permutable<decltype(std::ranges::__cust_access::__begin((declval<_Container&>)()))>) && (indirect_binary_predicate<std::ranges::equal_to, std::projected<decltype(std::ranges::__cust_access::__begin((declval<_Container&>)())), _Proj>, const _Tp*>)) constexpr std::ranges::borrowed_subrange_t<_Range1> std::ranges::__remove_fn::operator()(_Range&&, const _Tp&, _Proj) const [with _Range = std::vector<std::optional<int> >&; _Tp = std::nullopt_t; _Proj = std::identity]':
prog.cc:8:28:   required from 'auto remove_nulls(auto:19&) [with auto:19 = std::vector<std::optional<int> >]'
prog.cc:17:26:   required from here
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:336:13:   required for the satisfaction of 'invocable<_Fn, _Args ...>' [with _Fn = std::ranges::equal_to&; _Args = {std::optional<int>&, std::nullopt_t&}]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:340:13:   required for the satisfaction of 'regular_invocable<_Fn, _Args ...>' [with _Fn = std::ranges::equal_to&; _Args = {std::optional<int>&, std::nullopt_t&}]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:344:13:   required for the satisfaction of 'predicate<_Fn&, typename std::__detail::__iter_traits_impl<typename std::remove_cvref<_Tp2>::type, std::indirectly_readable_traits<typename std::remove_cvref<_Tp2>::type> >::type::value_type&, typename std::__detail::__iter_traits_impl<typename std::remove_cvref<_I2>::type, std::indirectly_readable_traits<typename std::remove_cvref<_I2>::type> >::type::value_type&>' [with _Fn = std::ranges::equal_to; _I2 = const std::nullopt_t*; _I1 = std::projected<__gnu_cxx::__normal_iterator<std::optional<int>*, std::vector<std::optional<int>, std::allocator<std::optional<int> > > >, std::identity>]
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/iterator_concepts.h:713:13:   required for the satisfaction of 'indirect_binary_predicate<std::ranges::equal_to, std::projected<decltype (std::ranges::__cust_access::__begin(declval<_Container&>())), _Proj>, const _Tp*>' [with _Range = std::vector<std::optional<int>, std::allocator<std::optional<int> > >&; _Proj = std::identity; _Tp = std::nullopt_t]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:336:25: note: the expression 'is_invocable_v<_Fn, _Args ...> [with _Fn = std::ranges::equal_to&; _Args = {std::optional<int>&, std::nullopt_t&}]' evaluated to 'false'
  336 |     concept invocable = is_invocable_v<_Fn, _Args...>;
      |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
prog.cc: In function 'int main()':
prog.cc:19:28: error: no match for call to '(std::ranges::equal_to) (std::optional<int>&, const std::nullopt_t&)'
   19 |     std::ranges::equal_to()(oi, std::nullopt);
      |     ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/iterator_concepts.h:37,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_iterator_base_types.h:71,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_algobase.h:65,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/vector:60,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_cmp.h:91:7: note: candidate: 'template<class _Tp, class _Up>  requires  equality_comparable_with<_Tp, _Up> constexpr bool std::ranges::equal_to::operator()(_Tp&&, _Up&&) const'
   91 |       operator()(_Tp&& __t, _Up&& __u) const
      |       ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_cmp.h:91:7: note:   template argument deduction/substitution failed:
/opt/wandbox/gcc-head/include/c++/12.0.0/bits/ranges_cmp.h:91:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/12.0.0/compare:39,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_pair.h:65,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/bits/stl_algobase.h:64,
                 from /opt/wandbox/gcc-head/include/c++/12.0.0/vector:60,
                 from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts: In substitution of 'template<class _Tp, class _Up>  requires  equality_comparable_with<_Tp, _Up> constexpr bool std::ranges::equal_to::operator()(_Tp&&, _Up&&) const [with _Tp = std::optional<int>&; _Up = const std::nullopt_t&]':
prog.cc:19:28:   required from here
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:278:15:   required for the satisfaction of '__weakly_eq_cmp_with<_Tp, _Tp>' [with _Tp = const std::nullopt_t&]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:288:13:   required for the satisfaction of 'equality_comparable<_Up>' [with _Up = const std::nullopt_t&]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:291:13:   required for the satisfaction of 'equality_comparable_with<_Tp, _Up>' [with _Tp = std::optional<int>&; _Up = const std::nullopt_t&]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:279:4:   in requirements with 'std::remove_reference_t<_Tp>& __t', 'std::remove_reference_t<_Up>& __u' [with _Up = const std::nullopt_t&; _Tp = const std::nullopt_t&]
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:280:17: note: the required expression '(__t == __u)' is invalid
  280 |           { __t == __u } -> __boolean_testable;
      |             ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:281:17: note: the required expression '(__t != __u)' is invalid
  281 |           { __t != __u } -> __boolean_testable;
      |             ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:282:17: note: the required expression '(__u == __t)' is invalid
  282 |           { __u == __t } -> __boolean_testable;
      |             ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/12.0.0/concepts:283:17: note: the required expression '(__u != __t)' is invalid
  283 |           { __u != __t } -> __boolean_testable;
      |             ~~~~^~~~~~
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
Exit Code:
1