<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><span class="vcard"><a class="email" href="mailto:john.brawn@arm.com" title="John Brawn <john.brawn@arm.com>"> <span class="fn">John Brawn</span></a>
</span> changed
<a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing error on explicit instantiation definition of undefined variable template"
href="https://bugs.llvm.org/show_bug.cgi?id=28816">bug 28816</a>
<br>
<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>What</th>
<th>Removed</th>
<th>Added</th>
</tr>
<tr>
<td style="text-align:right;">Resolution</td>
<td>---
</td>
<td>INVALID
</td>
</tr>
<tr>
<td style="text-align:right;">Status</td>
<td>NEW
</td>
<td>RESOLVED
</td>
</tr></table>
<p>
<div>
<b><a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing error on explicit instantiation definition of undefined variable template"
href="https://bugs.llvm.org/show_bug.cgi?id=28816#c1">Comment # 1</a>
on <a class="bz_bug_link
bz_status_RESOLVED bz_closed"
title="RESOLVED INVALID - Missing error on explicit instantiation definition of undefined variable template"
href="https://bugs.llvm.org/show_bug.cgi?id=28816">bug 28816</a>
from <span class="vcard"><a class="email" href="mailto:john.brawn@arm.com" title="John Brawn <john.brawn@arm.com>"> <span class="fn">John Brawn</span></a>
</span></b>
<pre>"template<int n> int var" is actually a definition of a template variable (with
an implicit initialization to zero), so the compiler's behaviour here is fine.
If you do "template<int n> extern int var" then that _is_ a declaration, and in
that case we get the error
tmp.cpp:2:14: error: explicit instantiation of undefined variable template
'var<0>'
template int var<0>;
^
tmp.cpp:1:28: note: explicit instantiation refers here
template<int n> extern int var;
^
1 error generated.</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>