<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 --- - The implicit version tuple's "reduced-arity-initialization" extension breaks conforming code."
href="https://llvm.org/bugs/show_bug.cgi?id=27374">27374</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>The implicit version tuple's "reduced-arity-initialization" extension breaks conforming code.
</td>
</tr>
<tr>
<th>Product</th>
<td>libc++
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>eric@efcs.ca
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>This bug tracks LWG issue #2419
(<a href="http://cplusplus.github.io/LWG/lwg-active.html#2419">http://cplusplus.github.io/LWG/lwg-active.html#2419</a>)
Calls to foo(v) can implicitly construct a n-tuple where n > 1 due to libc++'s
tuple extensions. This can cause overload resolution for foo(v) to select a
different overload than would otherwise be choosen for a conforming tuple
implementation. For example:
#include <iostream>
#include <tuple>
struct base
{
void out(const std::tuple<char, char>& w) const
{
std::cerr << "Tuple: " << std::get<0>(w) << std::get<1>(w) << '\n';
}
};
struct decorator
{
base b_;
template <typename... Args>
auto
out(Args&&... args)
-> decltype(b_.out(args...))
{
return b_.out(args...);
}
void out(const char& w)
{
std::cerr << "char: " << w << '\n';
}
};
int main()
{
decorator d{base{}};
char l = 'a';
d.out(l);
}
Libc++'s tuple will cause this program to print "Tuple: a" where it should
actually print "char: a".
The fix for this problem is to remove the extension on the implicit version of
the UTypes... constructors.</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>