https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85119
Bug ID: 85119 Summary: __builtin_expect() shadows warning Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: stefan.hertrampf at gmx dot de Target Milestone: --- Created attachment 43795 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=43795&action=edit example program to showcase the issue The builtin_expect() prevents the compiler to emit a warning in case you compare the this pointer with nullptr. Consider the attached code compiled with gcc 7.2.0 and following parameter: g++ gcc_bug.cc -Wall -Wextra -std=c++11