<html>
<head>
<base href="https://bugs.llvm.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 - Incorrect "use 'template' keyword to treat 'xxx' as a dependent template name" inside of virtual member functions of template classes"
href="https://bugs.llvm.org/show_bug.cgi?id=39047">39047</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect "use 'template' keyword to treat 'xxx' as a dependent template name" inside of virtual member functions of template classes
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>7.0
</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>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>duncan.horn@utexas.edu
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>E.g. the following code fails to compile:
template <typename T>
struct special_ptr
{
T* ptr;
template <typename U>
special_ptr<U> as()
{
special_ptr<U> result;
result.ptr = reinterpret_cast<U*>(this->ptr);
return result;
}
};
template <typename T>
struct thing
{
special_ptr<int> intPtr;
virtual void do_something()
{
auto charPtr = this->intPtr.as<char>();
}
};
struct empty {};
int main()
{
thing<empty> t;
}
You can also view it at <a href="https://godbolt.org/z/ywb5CS">https://godbolt.org/z/ywb5CS</a>. Note that GCC does not
have a problem with it. If you change 'thing' to no longer be a class template
_or_ if you make 'do_something' no longer virtual, it compiles fine.</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>