<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 - Compiler crashes on partial specialization of variable template with template template parameter"
href="https://bugs.llvm.org/show_bug.cgi?id=34953">34953</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Compiler crashes on partial specialization of variable template with template template parameter
</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>Windows NT
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>insertinterestingnamehere@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>This template is valid, and does compile with clang 3.9 and clang 5.0, but not
with clang 4 or trunk. Trunk crashes, and clang 4 gives an error.
See also <a href="https://godbolt.org/g/NGQNCm">https://godbolt.org/g/NGQNCm</a>.
Second similar example with structs further down.
To the best of my knowledge, both examples should be fine.
template <typename... param_types>
struct is_specified_instantiation_of {
template <typename T, template <param_types...> class container>
static constexpr bool value = false;
template <template <param_types...> class container, param_types... params>
static constexpr bool value<container<params...>, container> = true;
};
template <bool...>
struct bool_sequence {};
int main () {
static_assert(is_specified_instantiation_of<bool, bool>::template
value<bool_sequence<true, false>, bool_sequence>, "");
}
A related example that compiles with 3.8 but either fails or crashes with later
(crashes with trunk, see also <a href="https://godbolt.org/g/ZyTERb">https://godbolt.org/g/ZyTERb</a>)
template <typename... param_types>
struct is_specified_instantiation_of {
template <typename T, template <param_types...> class container>
struct val {
static constexpr bool value = false;
};
template <template <param_types...> class container, param_types... params>
struct val<container<params...>, container> {
static constexpr bool value = true;
};
};
template <bool...>
struct bool_sequence {};
int main () {
static_assert(is_specified_instantiation_of<bool, bool>::template
val<bool_sequence<true, false>, bool_sequence>::value, "");
}</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>