<html>
<head>
<base href="http://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 --- - Expected narrowing conversion during list initialization of bool from double"
href="http://llvm.org/bugs/show_bug.cgi?id=22566">22566</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Expected narrowing conversion during list initialization of bool from double
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</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>C++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yaghmour.shafik@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Given the following code form this stackoverflow question
<a href="http://stackoverflow.com/q/27507361/1708801">http://stackoverflow.com/q/27507361/1708801</a> :
#include <iostream>
struct X
{
X(bool arg) { std::cout << arg << '\n'; }
};
int main()
{
double d = 7.0;
X x{d};
}
I expect a narrowing conversion error on this line:
X x{d};
Neither clang nor gcc produce an error although Visual Studio does. Although
the comment is now deleted Jonathan Wakely noted that the EDG compiler gives a
narrowing error for the code.
Submitted a gcc bug report as well:
<a href="https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65043">https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65043</a></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>