https://bugs.llvm.org/show_bug.cgi?id=34953
Bug ID: 34953
Summary: Compiler crashes on partial specialization of variable
template with template template parameter
Product: clang
Version: trunk
Hardware: PC
OS: Windows NT
Status: NEW
Severity: enhancement
Priority: P
Component: C++
Assignee: unassignedclangb...@nondot.org
Reporter: insertinterestingnameh...@gmail.com
CC: dgre...@apple.com, llvm-bugs@lists.llvm.org
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 https://godbolt.org/g/NGQNCm.
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 https://godbolt.org/g/ZyTERb)
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, "");
}
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs