https://bugs.llvm.org/show_bug.cgi?id=34362
Bug ID: 34362
Summary: zero-as-null-pointer-constant warning on nullptr.
Product: clang
Version: trunk
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: -New Bugs
Assignee: unassignedclangb...@nondot.org
Reporter: bunge...@gmail.com
CC: llvm-bugs@lists.llvm.org
With the following content in zero.cc
struct A { operator int*() { return nullptr; } };
int main() { if (nullptr == A()) {} }
$ clang++ --version
clang version 6.0.0 (trunk 312002)
$ clang++ --std=c++11 -c zero.cc -Wzero-as-null-pointer-constant
zero.cc:2:18: warning: zero as null pointer constant
[-Wzero-as-null-pointer-constant]
int main() { if (nullptr == A()) {} }
^~~~~~~
nullptr
1 warning generated.
It appears that the user-defined conversion is getting in the way of the
detection somehow. This appears to have been introduced by D32914.
--
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