<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 --- - [[deprecated]] warning doesn't work on templates"
href="https://llvm.org/bugs/show_bug.cgi?id=31297">31297</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[[deprecated]] warning doesn't work on templates
</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>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++14
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>erich.keane@intel.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>So, the following code will only emit a 2 warnings (1st and 3rd), rather than
all 3:
struct [[deprecated]] no_template{};
template<typename T>
struct [[deprecated]] with_template{};
template<>
struct [[deprecated]] with_template<float>{};
int main()
{
no_template x1; // Warns appropriately
with_template<int> x2; // Does NOT warn!
with_template<float> x3; // Warns appropriately
}
Note that the specialization isn't necessary to suppress the 2nd warning. I
briefly have been attempting to debug this, and don't really see any attempts
to make it work for the template situation. So, I have 2 questions:
1- Is this done intentionally for standards compliance? I don't see any reason
why a template function SHOULDN'T accept deprecated.
2- If this is something we want, can anyone provide guidance as to where I can
start to implement this? I don't mind taking it, I just don't really have a
good idea where to start.</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>