http://llvm.org/bugs/show_bug.cgi?id=20901
Bug ID: 20901
Summary: -Wunused-private-field false positive with
__builtin_offsetof
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
The following C++ spuriously generates the "-Wunused-private-field" warning:
#include <cstdio>
class Meow
{
int x;
friend int main();
};
int main()
{
std::printf("%zu\n", __builtin_offsetof(Meow, x));
return 0;
}
prog.cc:5:9: warning: private field 'x' is not used [-Wunused-private-field]
int x;
^
clang version 3.6.0 (trunk 217508) Target: x86_64-unknown-linux-gnu Thread
model: posix
--
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