http://llvm.org/bugs/show_bug.cgi?id=17014
Bug ID: 17014
Summary: -Wunsused_variable gives false positive for template
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: C++
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected], [email protected]
Classification: Unclassified
clang version 3.4 (trunk 189329)
Target: x86_64-unknown-linux-gnu
Thread model: posix
#include <iostream>
#include <string>
struct bar {
int value;
};
struct foo {
foo( bar & b, int x)
{
b.value = x;
}
};
template<typename T>
struct baz {
void operator()(bar & b, T argc) const
{
foo false_positive_unsused_variable(b,argc);
std::cout << "Result is "<< b.value << std::endl;
}
};
int main(int argc, char **argv) {
bar b;
baz<int> z;
z(b, argc);
return 0;
}
clang++ -Wunused-variable -O3 -DNDEBUG -o
CMakeFiles/clang_test.dir/main.cpp.o -c
/home/artur/projects/clang_test/main.cpp
/home/artur/projects/clang_test/main.cpp:18:7: warning: unused variable
'false_positive_unsused_variable'
[-Wunused-variable]
foo false_positive_unsused_variable(b,argc);
^
I've checked
http://llvm.org/bugs/show_bug.cgi?id=9968
that one is fixed.
But it colud be connected with
http://llvm.org/bugs/show_bug.cgi?id=15532
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs