This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/70295] New: [6 Regression] bogus -Wnonnull-compare for "dynamic_cast<const FuSelection *>(this) != nullptr"


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)
               ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]