[Bug c/87682] New: gcc/mem-stats.h:172: possible broken comparison operator ?

dcb314 at hotmail dot com gcc-bugzilla@gcc.gnu.org
Mon Oct 22 06:53:00 GMT 2018


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87682

            Bug ID: 87682
           Summary: gcc/mem-stats.h:172: possible broken comparison
                    operator ?
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

gcc/mem-stats.h:172]: (style) Same expression on both sides of '&&'.

Source code is

  inline bool
  operator== (const mem_usage &second) const
  {
    return (m_allocated == second.m_allocated
            && m_peak == second.m_peak
            && m_allocated == second.m_allocated);
  }

Looking at nearby operator <, shouldn't this be

  inline bool
  operator== (const mem_usage &second) const
  {
    return (m_allocated == second.m_allocated
            && m_peak == second.m_peak
            && m_times == second.m_times);
  }


More information about the Gcc-bugs mailing list