<html>
<head>
<base href="http://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 --- - use 'template' keyword to treat 'get' as a dependent template name [fails if get<>() is called via array: a[0].get<>(), otherwise works: b.get<>()]"
href="http://llvm.org/bugs/show_bug.cgi?id=22247">22247</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>use 'template' keyword to treat 'get' as a dependent template name [fails if get<>() is called via array: a[0].get<>(), otherwise works: b.get<>()]
</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++
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedclangbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>david.abdurachmanov@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>dgregor@apple.com, llvmbugs@cs.uiuc.edu
</td>
</tr>
<tr>
<th>Classification</th>
<td>Unclassified
</td>
</tr></table>
<p>
<div>
<pre>Reduced and discussed testcase at #llvm
class foo {
public:
template<typename T> T get() const;
};
template <class T>
class bar {
private:
foo x;
foo y[1];
public:
bar() {
x.get<int>(); // ok
y[0].get<int>(); // error?!
}
};
prog.cc:15:10: error: use 'template' keyword to treat 'get' as a dependent
template name y[0].get<int>(); // error?! ^ template 1 error generated.
get<>() is not dependent on template parameters. The compiler treats get<>()
unfairly if it's called via array, otherwise works just fine.
I assume some internal check if Clang does not catch/match all options.
C++ 14.2/4 only lists examples where a method call is directly dependent on
template parameters. In that case using "template" keyword is required. In this
testcase get<>() is not dependent on class template parameters.</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>