<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 -Wunused-lambda-capture warning for this capture"
href="https://bugs.llvm.org/show_bug.cgi?id=36880">36880</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Incorrect -Wunused-lambda-capture warning for this capture
</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>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</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>arphaman@gmail.com
</td>
</tr>
<tr>
<th>CC</th>
<td>llvm-bugs@lists.llvm.org
</td>
</tr></table>
<p>
<div>
<pre>$ cat test.cpp
template<class T>
struct DummyTemplate {
template<class T2>
void methodTemplate(const T2&){}
void ToTemplate(const int& param){
[this](const auto& p){methodTemplate(p);}(param);
}
};
int main()
{
int i{};
DummyTemplate<bool> dt;
dt.ToTemplate(i);
}
$ clang test.cpp -std=c++14 -Wunused-lambda-capture
test.cpp:7:10: warning: lambda capture 'this' is not used
[-Wunused-lambda-capture]
[this](const auto& p){methodTemplate(p);}(param);
^
test.cpp:15:8: note: in instantiation of member function
'DummyTemplate<bool>::ToTemplate' requested here
dt.ToTemplate(i);
^
1 warning 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>