<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 --- - [ms] Unqualified lookup in dependent classes doesn't work for member template calls with explicit type parameters"
href="http://llvm.org/bugs/show_bug.cgi?id=22066">22066</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>[ms] Unqualified lookup in dependent classes doesn't work for member template calls with explicit type parameters
</td>
</tr>
<tr>
<th>Product</th>
<td>clang
</td>
</tr>
<tr>
<th>Version</th>
<td>unspecified
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</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>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>nicolasweber@gmx.de
</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>This compiles (good):
template<class T> struct Base {
template<class G> void f(G t) {}
};
template<class T> struct Sub : Base<T> {
void g() {
f(4);
}
};
void foo() {
Sub<int> i;
i.g();
}
D:\src\chromefetch\src\out\Release>
"D:\\src\\llvm-ninja-rel64\\bin\\clang-cl.exe" -m32 /c foo.ii
foo.ii(7,5) : warning: use of identifier 'f' found via unqualified lookup into
dependent bases of class templates is a
Microsoft extension [-Wmicrosoft]
f(4);
^
this->
But this doesn't:
template<class T> struct Base {
template<class G> void f(G t) {}
};
template<class T> struct Sub : Base<T> {
void g() {
f<int>(4);
}
};
void foo() {
Sub<int> i;
i.g();
}
D:\src\chromefetch\src\out\Release>
"D:\\src\\llvm-ninja-rel64\\bin\\clang-cl.exe" -m32 /c foo.ii
foo.ii(7,5) : warning: use of undeclared identifier 'f'; unqualified lookup
into dependent bases of class template 'Sub' is
a Microsoft extension [-Wmicrosoft]
f<int>(4);
^
this->
foo.ii(7,10) : error: expected '(' for function-style cast or type
construction
f<int>(4);
~~~^
1 warning and 1 error generated.
With the `this->`, another warning is emitted:
template<class T> struct Base {
template<class G> void f(G t) {}
};
template<class T> struct Sub : Base<T> {
void g() {
this->f<int>(4);
}
};
void foo() {
Sub<int> i;
i.g();
}
D:\src\chromefetch\src\out\Release>
"D:\\src\\llvm-ninja-rel64\\bin\\clang-cl.exe" -m32 /c foo.ii
foo.ii(7,11) : warning: use 'template' keyword to treat 'f' as a dependent
template name
this->f<int>(4);
^
template
1 warning generated.
I guess the fixit recovery we do with the this-> bit isn't applied correctly
with the fixit we do in MS mode for adding the "this->" somehow.</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>