<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 --- - Should clang warn about partial specialization after instantiation?"
href="https://llvm.org/bugs/show_bug.cgi?id=25367">25367</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Should clang warn about partial specialization after instantiation?
</td>
</tr>
<tr>
<th>Product</th>
<td>new-bugs
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</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>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>new bugs
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>yaron.keren@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org, richard-llvm@metafoo.co.uk
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>In the code below, T2<int,int> will not have mytype member, as T2<int,int> is
first instantiated in line 2 and then T2<T,int> specialized in line 3.
1 template <typename T, typename> struct T2 {};
2 template struct T2<int, int>;
3 template <typename T> struct T2<T, int> { typedef int mytype; };
4 void foo() { T2<int,int>::mytype i; }
If we swap lines 2 and 3, T2<int,int> will have mytype as T2<int,int> will find
and use the specialization T2<T,int>.
Similar to error: explicit specialization after instantiation, should we error
or warn about this, a specialization that would have changed existing
instantiation if it would have come before it?</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>