<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 - Error in num_get::do_get for custom character type"
href="https://bugs.llvm.org/show_bug.cgi?id=48814">48814</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Error in num_get::do_get for custom character type
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>11.0
</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>normal
</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>zilla@kayari.org
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>template <class _CharT, class _InputIterator>
_InputIterator
num_get<_CharT, _InputIterator>::do_get(iter_type __b, iter_type __e,
ios_base& __iob,
ios_base::iostate& __err,
void*& __v) const
{
// Stage 1
int __base = 16;
// Stage 2
char_type __atoms[26];
char_type __thousands_sep = 0;
This assumes that char_type can be unambiguously constructed from an int, but
that isn't necessarily true. Consider a character-like class type (with
appropriate specialization of char_traits):
struct charlike
{
charlike() = default;
charlike(char);
charlike(wchar_t);
// ...
};
This will give an error in num_get, as seen at:
<a href="https://github.com/maekitalo/cxxtools/issues/27">https://github.com/maekitalo/cxxtools/issues/27</a>
Using "char_type __thousands_sep = char_type();" should work.</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>