<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 --- - Passing template alias as template template parameter causes specialization matching to fail"
href="https://llvm.org/bugs/show_bug.cgi?id=26093">26093</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Passing template alias as template template parameter causes specialization matching to fail
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>3.7
</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++11
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>grygoriy.fuchedzhy@gmail.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>Hi, here is example of code which I believe valid, compiles using gcc-4.9.3 but
fails to compile with clang-3.5.2, clang-3.6.2 and 3.7.0.
template<bool val> struct bool_type
{
static constexpr bool value = val;
};
template<typename T, template<typename...> class Template>
struct inst_of : bool_type<false> {};
template<template<typename...> class Template, typename... Params>
struct inst_of<Template<Params...>, Template> : bool_type<true> {};
template<typename X>
struct some_templ;
template<typename X>
using some_alias = some_templ<X>;
static_assert(inst_of<some_templ<int>, some_templ>::value, "");//ok
static_assert(inst_of<some_alias<int>, some_templ>::value, "");//ok
static_assert(inst_of<some_alias<int>, some_alias>::value, "");//assert
static_assert(inst_of<some_templ<int>, some_alias>::value, "");//assert
//some more tests
template<typename T>
struct inst_of_some_templ : bool_type<false> {};
template<typename T>
struct inst_of_some_templ<some_templ<T>> : bool_type<true> {};
template<typename T>
struct inst_of_some_alias : bool_type<false> {};
template<typename T>
struct inst_of_some_alias<some_alias<T>> : bool_type<true> {};
static_assert(inst_of_some_templ<some_templ<int>>::value, "");//ok
static_assert(inst_of_some_templ<some_alias<int>>::value, "");//ok
static_assert(inst_of_some_alias<some_alias<int>>::value, "");//ok
static_assert(inst_of_some_alias<some_templ<int>>::value, "");//ok</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>