<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 - libc++ tests compare std::fpos with int"
href="https://bugs.llvm.org/show_bug.cgi?id=36996">36996</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>libc++ tests compare std::fpos with int
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>billy.oneal@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Libc++ tests, such as
test\std\input.output\file.streams\fstreams\filebuf.virtuals\seekoff.pass.cpp
contain asserts like the following:
typedef std::filebuf::pos_type pos_type;
...
pos_type p = /* ... */
assert(p == 11);
The assert line fails to compile on MSVC because overloads have similar
conversions. Either a user defined conversion can be done from fpos to
streamoff, and then the streamoff compared with int, or the int can be
converted to a streamoff converted into an fpos, and the fpos instances
compared.
.\src\qa\vc\Libs\libcxx\upstream\test\std\input.output\file.streams\fstreams\filebuf.virtuals\seekoff.pass.cpp(35):
error C2666: 'std::fpos<_Mbstatet>::operator ==': 3 overloads have similar
conversions
D:\msvc\binaries\x86ret\inc\iosfwd(101): note: could be 'bool
std::fpos<_Mbstatet>::operator ==(std::streamoff) const'
D:\msvc\binaries\x86ret\inc\iosfwd(96): note: or 'bool
std::fpos<_Mbstatet>::operator ==(const std::fpos<_Mbstatet> &) const'
[ ... ]
.\src\qa\vc\Libs\libcxx\upstream\test\std\input.output\file.streams\fstreams\filebuf.virtuals\seekoff.pass.cpp(35):
note: or 'built-in C++ operator==(std::streamoff, int)'
.\src\qa\vc\Libs\libcxx\upstream\test\std\input.output\file.streams\fstreams\filebuf.virtuals\seekoff.pass.cpp(35):
note: while trying to match the argument list '(pos_type, int)'
[fpos.operations] Table 104 only allows comparison of an fpos with other fpos
instances, not with int. Either the tests should cast the integral value into
an fpos before doing the comparison, or the fpos should be cast to a streamsize
or streamoff.
(Billy is willing to submit a change to resolve this bug but isn't sure which
way you want the cast to go)</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>