<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</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 - Template functions in templates missing member symbols"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=170">170</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Template functions in templates missing member symbols
</td>
</tr>
<tr>
<th>Product</th>
<td>GDC
</td>
</tr>
<tr>
<th>Version</th>
<td>4.8.x
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>Normal
</td>
</tr>
<tr>
<th>Component</th>
<td>gdc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>ibuclaw@gdcproject.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>obscurans@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>Template functions in a template scope aren't inferring instantiations
correctly. This is a bit hard to explain so here's a MWE:
---file1
module foobar;
class bar(T) {
void undefined_reference() {}
}
template foo(T) {
bar!T foo1(T2)() if (true) body { return null; }
bar!T foo2(T2)() { return null; }
bar!T foo3(T2 = void)() if (true) body { return null; }
bar!T foo4(T2 = void)() { return null; }
void foo5(T2)(bar!T x) if (true) body {}
void foo6(T2)(bar!T x) {}
void foo7(T2 = void)(bar!T x) if (true) body {}
void foo8(T2 = void)(bar!T x) {}
}
---end
---file2
import foobar;
void main() {
foo!void.foo1!void(); // succeeds
foo!void.foo2!void(); // succeeds
foo!void.foo3(); // succeeds
foo!void.foo3!void(); // succeeds
foo!void.foo4(); // succeeds
foo!void.foo4!void(); // succeeds
// foo!void.foo5!void(null); // fails!
foo!void.foo6!void(null); // succeeds
foo!void.foo7(null); // succeeds
// foo!void.foo7!void(null); // fails!
foo!void.foo8(null); // succeeds
foo!void.foo8!void(null); // succeeds
}
---end
Uncomment the failing lines, and I get (on 4.8.2) a linker error missing void
foobar.bar!(void).bar.undefined_reference().
If they are in the same file nothing fails. For parameters only, it fails only
if both a template argument was given and a template constraint exists.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>