This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/70295] New: [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"
- From: "trippels at gcc dot gnu.org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Fri, 18 Mar 2016 13:56:45 +0000
- Subject: [Bug c++/70295] New: [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70295
Bug ID: 70295
Summary: [6 Regression] bogus -Wnonnull-compare for
"dynamic_cast<const FuSelection *>(this) != nullptr"
Product: gcc
Version: 6.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: trippels at gcc dot gnu.org
Target Milestone: ---
trippels@CFARM-IUT-TLSE3 ~ % cat fudraw.ii
enum SdrHitKind {};
class FuSelection {
void m_fn1(void *);
};
void FuSelection::m_fn1(void *) {
SdrHitKind eHit;
if (eHit && dynamic_cast<const FuSelection *>(this) != nullptr)
;
}
trippels@CFARM-IUT-TLSE3 ~ % g++ -c -O2 -Wnonnull-compare fudraw.ii
fudraw.ii: In member function âvoid FuSelection::m_fn1(void*)â:
fudraw.ii:7:55: warning: nonnull argument âthisâ compared to NULL
[-Wnonnull-compare]
if (eHit && dynamic_cast<const FuSelection *>(this) != nullptr)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~