Closed yurivict closed 3 years ago
Partial fix: https://github.com/Gecode/gecode/pull/111
The other part of the problem is this warning:
In file included from /usr/local/include/gecode/driver.hh:37:
In file included from /usr/local/include/gecode/minimodel.hh:51:
In file included from /usr/local/include/gecode/float.hh:835:
/usr/local/include/gecode/float/val.hpp:296:18: warning: ISO C++20 considers use of overloaded operator '==' (with operand types 'const Gecode::FloatVal::FloatValImpType' (aka 'const interval<double, policies<save_state<Float::Rounding>, checking_strict<double> > >') and 'const Gecode::FloatVal::FloatValImpType') to be ambiguous despite there being a unique best viable function [-Wambiguous-reversed-operator]
return x.x == y.x;
~~~ ^ ~~~
/usr/local/include/boost/numeric/interval/interval.hpp:84:8: note: ambiguity is between a regular call to this operator and a call with the argument order reversed
bool operator== (const interval_holder& r) const;
^
and this error:
In file included from /usr/local/include/gecode/driver.hh:37:
In file included from /usr/local/include/gecode/minimodel.hh:51:
In file included from /usr/local/include/gecode/float.hh:833:
/usr/local/include/gecode/float/val.hpp:319:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'const Gecode::FloatVal::FloatValImpType' (aka 'const interval<double, policies<save_state<Float::Rounding>, checking_strict<double> > >') and 'const Gecode::FloatVal::FloatValImpType')
return x.x != y.x;
~~~ ^ ~~~
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:85:8: note: candidate function
bool operator!= (const interval_holder& r) const;
^
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function
bool operator== (const interval_holder& r) const;
^
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function (with reversed parameter order)
1 warning and 1 error generated.
I first thought that this was related to an outdated bundled boost library, but the same error/warning happen with the latest boost.
Thanks for the fix i #111. As for the latter warning, there are some warnings still in Gecode that needs fixing. Will have to wait for the next release though.
I'll close this issue for now as it compiles, leaving fixing warnings for later. Thanks for the report.
There is still this c++2a error though:
In file included from /usr/local/include/gecode/minimodel.hh:51:
In file included from /usr/local/include/gecode/float.hh:833:
/usr/local/include/gecode/float/val.hpp:319:18: error: use of overloaded operator '!=' is ambiguous (with operand types 'const Gecode::FloatVal::FloatValImpType' (aka 'const interval<double, policies<save_state<Float::Rounding>, checking_strict<double> > >') and 'const Gecode::FloatVal::FloatValImpType')
return x.x != y.x;
~~~ ^ ~~~
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:85:8: note: candidate function
bool operator!= (const interval_holder& r) const;
^
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function
bool operator== (const interval_holder& r) const;
^
/usr/local/include/gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function (with reversed parameter order)
Ah, I thought it was warnings only. Re-opening.
The remaining c++20 error appears to be bogus and clang-12 doesn't have it any more.
Describe the bug
clang-10 fails to compile
gecode/driver.hh
with-std=c++2a
:The symbol
std::memory_order::memory_order_seq_cst
exists untilc++20
, but sincec++20
is renamed intostd::memory_order::seq_cst
, see https://en.cppreference.com/w/cpp/atomic/memory_orderTo Reproduce
Create a file
x.cpp
with the line#include <gecode/driver.hh>
. Runc++ -std=c++2a x.cpp -I /usr/local/include/ -c
Gecode and Platform Configuration
Version 3.6.0 OS: FreeBSD 12.2 clang 10