Author
anonymous
over 4 years ago
Language
C++
Compiler
gcc HEAD 11.0.1 20210321 (experimental)
Options
Warnings
Don't Use Boost
C++2a
no pedantic
Author
anonymous
over 4 years ago
$ g++ prog.cc -Wall -Wextra -std=c++2a prog.cc: In function 'int main()':
prog.cc:29:39: error: no match for call to '(std::compare_three_way) (Rational_2&, Rational_2&)'
29 | print(std::compare_three_way{}(c,d));
| ^
In file included from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_pair.h:65,
from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_algobase.h:64,
from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/char_traits.h:39,
from /opt/wandbox/gcc-head/include/c++/11.0.1/ios:40,
from /opt/wandbox/gcc-head/include/c++/11.0.1/ostream:38,
from /opt/wandbox/gcc-head/include/c++/11.0.1/iostream:39,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.1/compare:506:7: note: candidate: 'template<class _Tp, class _Up> requires three_way_comparable_with<_Tp, _Up, std::partial_ordering> constexpr auto std::compare_three_way::operator()(_Tp&&, _Up&&) const'
506 | operator()(_Tp&& __t, _Up&& __u) const
| ^~~~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.1/compare:506:7: note: template argument deduction/substitution failed:
/opt/wandbox/gcc-head/include/c++/11.0.1/compare:506:7: note: constraints not satisfied
In file included from /opt/wandbox/gcc-head/include/c++/11.0.1/compare:39,
from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_pair.h:65,
from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/stl_algobase.h:64,
from /opt/wandbox/gcc-head/include/c++/11.0.1/bits/char_traits.h:39,
from /opt/wandbox/gcc-head/include/c++/11.0.1/ios:40,
from /opt/wandbox/gcc-head/include/c++/11.0.1/ostream:38,
from /opt/wandbox/gcc-head/include/c++/11.0.1/iostream:39,
from prog.cc:1:
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts: In substitution of 'template<class _Tp, class _Up> requires three_way_comparable_with<_Tp, _Up, std::partial_ordering> constexpr auto std::compare_three_way::operator()(_Tp&&, _Up&&) const [with _Tp = Rational_2&; _Up = Rational_2&]':
prog.cc:29:39: required from here
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:280:15: required for the satisfaction of '__weakly_eq_cmp_with<_Tp, _Tp>' [with _Tp = Rational_2&]
/opt/wandbox/gcc-head/include/c++/11.0.1/compare:418:13: required for the satisfaction of 'three_way_comparable<_Tp, _Cat>' [with _Tp = Rational_2&; _Cat = std::partial_ordering]
/opt/wandbox/gcc-head/include/c++/11.0.1/compare:428:13: required for the satisfaction of 'three_way_comparable_with<_Tp, _Up, std::partial_ordering>' [with _Tp = Rational_2&; _Up = Rational_2&]
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:281:4: in requirements with 'std::remove_reference_t<_Tp>& __t', 'std::remove_reference_t<_Rhs>& __u' [with _Up = Rational_2&; _Tp = Rational_2&]
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:282:17: note: the required expression '(__t == __u)' is invalid
282 | { __t == __u } -> __boolean_testable;
| ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:283:17: note: the required expression '(__t != __u)' is invalid
283 | { __t != __u } -> __boolean_testable;
| ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:284:17: note: the required expression '(__u == __t)' is invalid
284 | { __u == __t } -> __boolean_testable;
| ~~~~^~~~~~
/opt/wandbox/gcc-head/include/c++/11.0.1/concepts:285:17: note: the required expression '(__u != __t)' is invalid
285 | { __u != __t } -> __boolean_testable;
| ~~~~^~~~~~
cc1plus: note: set '-fconcepts-diagnostics-depth=' to at least 2 for more detail
Exit Code:
1