<html>
<head>
<base href="https://llvm.org/bugs/" />
</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 --- - std::linear_congruential_engine dies when type is uint8_t"
href="https://llvm.org/bugs/show_bug.cgi?id=23462">23462</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>std::linear_congruential_engine dies when type is uint8_t
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>3.6
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>oneill+llvmbugs@cs.hmc.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvmbugs@cs.uiuc.edu, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=14305" name="attach_14305" title="Code that shows the bug">attachment 14305</a> <a href="attachment.cgi?id=14305&action=edit" title="Code that shows the bug">[details]</a></span>
Code that shows the bug
If you try to create an 8-bit LCG, the code fails to compile (instantiation of
the function-call operator fails).
Compile the attached code with
clang++ -std=c++11 -o uint8_lcg uint8_lcg.cpp
Observe the following errors.
In file included from uint8_lcg.cpp:1:
/some/where/llvm.236909/bin/../include/c++/v1/random:1888:49: error:
implicit instantiation of undefined template 'std::__1::__lce_ta<141, 1,
0, 255, false>'
{return __x_ = static_cast<result_type>(__lce_ta<__a, __c, __m, ...
^
uint8_lcg.cpp:9:7: note: in instantiation of member function
'std::__1::linear_congruential_engine<unsigned char, '\x8D', '\x01',
'\x00'>::operator()' requested here
gen();
^
/some/where/llvm.236909/bin/../include/c++/v1/random:1672:8: note: template
is declared here
struct __lce_ta;
^
/some/where/llvm.236909/bin/../include/c++/v1/random:1888:77: error:
incomplete definition of type 'std::__1::__lce_ta<141, 1, 0, 255, false>'
...__x_ = static_cast<result_type>(__lce_ta<__a, __c, __m,
_Mp>::next(__x_));}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~
2 errors generated.
The standard doesn't restrict the integer type that may be used, so this is an
erroneous error. Present in trunk and 3.6. GCC 5.1 and earlier (libstdc++)
compile the code correctly.</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>