<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 - Variant constructors forbid narrowing conversions"
href="https://bugs.llvm.org/show_bug.cgi?id=43004">43004</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Variant constructors forbid narrowing conversions
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>9.0
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Other
</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>All Bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>David.Truby@arm.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Created <span class=""><a href="attachment.cgi?id=22377" name="attach_22377" title="Narrowing conversion in variant constructor doesn't compile">attachment 22377</a> <a href="attachment.cgi?id=22377&action=edit" title="Narrowing conversion in variant constructor doesn't compile">[details]</a></span>
Narrowing conversion in variant constructor doesn't compile
I've attached a very simple file that builds with libc++ 8 and libstdc++ but
fails to build with libc++ 9. I've narrowed the change down to this commit
implementing P0608R3: <a href="https://reviews.llvm.org/D44865">https://reviews.llvm.org/D44865</a>.
It appears that the paper forbids all narrowing conversions when constructing a
variant, is my understanding of that correct? If so it seems that this changes
behaviour in a way that breaks backwards compatibility even for code that isn't
defective and is valid C++17.</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>