<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 - Parameter packs and variadic arguments: Clang, gcc, and msvc differ on this one"
href="https://bugs.llvm.org/show_bug.cgi?id=49852">49852</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Parameter packs and variadic arguments: Clang, gcc, and msvc differ on this one
</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>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>matthurd@acm.org
</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>Clang on trunk, 11, and 10 seems to get the "add_three" second example below
wrong. Clang 9 generates an error FWIW.
____________________
gcc, clang, and msvc all compile this fun one:
auto foo(auto......) { return 42; }
int add_three() { return foo<int,int>(3,4,5); }
____________________
But they argue about this curious one:
[[nodiscard]] constexpr auto foo(auto...t...) noexcept {return (... + t);}
int add_three() { return foo<int,int>(3,4,5);} //gcc(7), clang(12), msvc(err)
int add_more() { return foo(3,4,5,6); } //gcc(18), clang(18), msvc(err)
<a href="https://godbolt.org/z/cEoYrn4T8">https://godbolt.org/z/cEoYrn4T8</a>
____________________
It feels to me like gcc is doing the right thing. Which two compilers have
bugs?
--Matt.</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>