<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 - undefined behavior santizer compiler segfault __int128_t non-type template parameter"
href="https://bugs.llvm.org/show_bug.cgi?id=43472">43472</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>undefined behavior santizer compiler segfault __int128_t non-type template parameter
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>Linux
</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>C++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>patrick.a.moran@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>blitzrakete@gmail.com, dgregor@apple.com, erik.pilkington@gmail.com, llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22583" name="attach_22583" title="The preprocessed source of the repro">attachment 22583</a> <a href="attachment.cgi?id=22583&action=edit" title="The preprocessed source of the repro">[details]</a></span>
The preprocessed source of the repro
I'm encountering a segfault in the clang 9.0.0 compiler under code I've
attached:
* It only manifests with -fsanitize=undefined
* It only manifests at -O1 and up (not at -O0)
* It only manifests when the template struct has a typename template parameter
and a non-type template parameter of that type.
* It only manifests when the type argument is __int128_t
* It only manifests when a static member function of the template class
returns an instance of the class **and** a function consumes the value
* If you just cast the return of the static member function to void, the
issue does not reproduce.
* It manifests at standards c++03, c++11, c++14, c++17 and c++2a.
The diagnostic message:
********************
PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-9: note: diagnostic msg: /tmp/test_fixed_point-11869e.cpp
clang-9: note: diagnostic msg: /tmp/test_fixed_point-11869e.sh
clang-9: note: diagnostic msg:
********************</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>