<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 --- - ICE when constructing tuple"
href="https://llvm.org/bugs/show_bug.cgi?id=24518">24518</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>ICE when constructing tuple
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</td>
</tr>
<tr>
<th>Hardware</th>
<td>Macintosh
</td>
</tr>
<tr>
<th>OS</th>
<td>MacOS X
</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>_@adityaramesh.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>I tried compiling some code involving `std::tuple` using clang 3.7 (trunk
241984, downloaded via Macports) and clang 3.6.1 (also downloaded via
Macports). Compiling under clang-3.7 results in an ICE. On the other hand,
clang-3.6.1 produces a spurious error message. I've attached the preprocessed
source file and run script resulting from the ICE.
I've looked into the spurious error message given by clang-3.6, but I have not
been able to produce a MWE. In short, here's what's happening. I'm writing a
multidimensional array library, and have a class like this:
template <class Func, class... Ts>
struct elemwise_expr final
{
std::tuple<const Ts&...> m_refs;
const Func& m_func;
public:
CC_ALWAYS_INLINE
explicit elemwise_expr(const Func& f, const Ts&... ts)
noexcept : m_refs{ts...}, m_func{f} {}
// Code omitted.
};
When I compile this code under clang-3.6.1, the compiler generates several "no
matching constructor for initialization of ..." errors involving types from my
library. After looking over my own code carefully, I realized that the error
was generated by the `__is_constructible` test for the `tuple(_Up&&... __u)`
constructor. It turns out that for some reason, this constructor appears to
have been supplied only one argument -- a tuple -- despite the fact that none
of the types `ts...` in my own code are tuples. Somehow, the arguments used to
initialize `m_refs` are being redundantly nested in a tuple. The
`__is_constructible` test then tries to invoke the constructors of various
types in my library with a single tuple as an argument, and this fails. My
guess is that this strange error becomes an ICE under clang 3.7.
Do you have any recommendations for workarounds, or how I could produce an MWE?
I believe you should be able to compile the preprocessed source file under
clang-3.6.1 instead of clang-3.7 to get the same results.</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>