<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - clang++ prints bogus error: use of overloaded operator '!=' is ambiguous"
href="https://bugs.llvm.org/show_bug.cgi?id=50366">50366</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>clang++ prints bogus error: use of overloaded operator '!=' is ambiguous
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>10.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>FreeBSD
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>C++2a
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yuri@tsoft.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>The Gecode project <a href="https://github.com/Gecode/gecode">https://github.com/Gecode/gecode</a> (release/6.3.0 branch
rev.ad52315) fails with -std=c++2a:
<span class="quote">> In file included from gecode/float/var-imp/float.cpp:41:
> In file included from ./gecode/float.hh:833:
> ./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;
> ~~~ ^ ~~~
> ./gecode/third-party/boost/numeric/interval/interval.hpp:85:8: note: candidate function
> bool operator!= (const interval_holder& r) const;
> ^
> ./gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function
> bool operator== (const interval_holder& r) const;
> ^
> ./gecode/third-party/boost/numeric/interval/interval.hpp:84:8: note: candidate function (with reversed parameter order)
> In file included from gecode/float/rel.cpp:36:
> In file included from ./gecode/float/rel.hh:46:
> In file included from ./gecode/float.hh:833:
> ./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;
> ~~~ ^ ~~~
> ./gecode/third-party/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;
> ^</span >
Both operand types in the error message are same: 'const
Gecode::FloatVal::FloatValImpType'
It doesn't make sense that type order reversal can cause ambiguity.
Additionally, when compiled with -Wno-ambiguous-reversed-operator this error
message is still printed.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>