https://bugs.llvm.org/show_bug.cgi?id=36880
Bug ID: 36880
Summary: Incorrect -Wunused-lambda-capture warning for this
capture
Product: clang
Version: trunk
Hardware: PC
OS: All
Status: NEW
Severity: enhancement
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: arpha...@gmail.com
CC: llvm-bugs@lists.llvm.org
$ 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.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs