<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 - Prebuilt Windows x64 binary allows conversion from false to pointer"
href="https://bugs.llvm.org/show_bug.cgi?id=45725">45725</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Prebuilt Windows x64 binary allows conversion from false to pointer
</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>Windows NT
</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++17
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>phork@seiryu.org
</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>Created <span class=""><a href="attachment.cgi?id=23416" name="attach_23416" title="test code">attachment 23416</a> <a href="attachment.cgi?id=23416&action=edit" title="test code">[details]</a></span>
test code
Prebuilt clang for Windows x64 which can be downloaded from
<a href="https://llvm.org/builds/">https://llvm.org/builds/</a> compiles the test code with the following output. I
tried both 11.0.0(2663a25f) and 10.0.0.
============
<span class="quote">>"\Program Files\LLVM\bin\clang.exe" -Wall -Wextra -std=c++17 -c test1.cpp</span >
test.cpp:6:28: warning: initialization of pointer of type 'const char *' to
null
from a constant boolean expression [-Wbool-conversion]
[[maybe_unused]] s t = false;
^~~~~
1 warning generated.
============
Expected result is error like below.
============
test.cpp:6:24: error: no viable conversion from 'bool' to 's'
[[maybe_unused]] s t = false;
^ ~~~~~
test.cpp:1:8: note: candidate constructor (the implicit copy constructor) not
viable: no known conversion from 'bool' to 'const s &' for 1st argument
struct s {
^
test.cpp:1:8: note: candidate constructor (the implicit move constructor) not
viable: no known conversion from 'bool' to 's &&' for 1st argument
struct s {
^
test.cpp:2:5: note: candidate constructor not viable: no known conversion from
'bool' to 'const char *' for 1st argument
s(const char *) {}
^
1 error generated.
============</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>