public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-6689] analyzer: const fixes [PR98679]
@ 2021-01-14 20:30 David Malcolm
  0 siblings, 0 replies; only message in thread
From: David Malcolm @ 2021-01-14 20:30 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:8a18261afd923151b8d2a37f667e4673b27acd3f

commit r11-6689-g8a18261afd923151b8d2a37f667e4673b27acd3f
Author: David Malcolm <dmalcolm@redhat.com>
Date:   Thu Jan 14 15:25:27 2021 -0500

    analyzer: const fixes [PR98679]
    
    gcc/analyzer/ChangeLog:
            PR analyzer/98679
            * analyzer.h (region_offset::operator==): Make const.
            * pending-diagnostic.h (pending_diagnostic::equal_p): Likewise.
            * store.h (binding_cluster::for_each_value): Likewise.
            (binding_cluster::for_each_binding): Likewise.

Diff:
---
 gcc/analyzer/analyzer.h           | 2 +-
 gcc/analyzer/pending-diagnostic.h | 2 +-
 gcc/analyzer/store.h              | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/gcc/analyzer/analyzer.h b/gcc/analyzer/analyzer.h
index f603802c0d6..6996092717c 100644
--- a/gcc/analyzer/analyzer.h
+++ b/gcc/analyzer/analyzer.h
@@ -169,7 +169,7 @@ public:
     return m_offset;
   }
 
-  bool operator== (const region_offset &other)
+  bool operator== (const region_offset &other) const
   {
     return (m_base_region == other.m_base_region
 	    && m_offset == other.m_offset
diff --git a/gcc/analyzer/pending-diagnostic.h b/gcc/analyzer/pending-diagnostic.h
index 79dc83edc32..571fc1b56b9 100644
--- a/gcc/analyzer/pending-diagnostic.h
+++ b/gcc/analyzer/pending-diagnostic.h
@@ -157,7 +157,7 @@ class pending_diagnostic
   /* Compare for equality with OTHER, which might be of a different
      subclass.  */
 
-  bool equal_p (const pending_diagnostic &other)
+  bool equal_p (const pending_diagnostic &other) const
   {
     /* Check for pointer equality on the IDs from get_kind.  */
     if (get_kind () != other.get_kind ())
diff --git a/gcc/analyzer/store.h b/gcc/analyzer/store.h
index 366439ce2dd..2bcef6c398a 100644
--- a/gcc/analyzer/store.h
+++ b/gcc/analyzer/store.h
@@ -425,7 +425,7 @@ public:
 
   template <typename T>
   void for_each_value (void (*cb) (const svalue *sval, T user_data),
-		       T user_data)
+		       T user_data) const
   {
     for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter)
       cb ((*iter).second, user_data);
@@ -459,7 +459,7 @@ public:
   const svalue *maybe_get_simple_value (store_manager *mgr) const;
 
   template <typename BindingVisitor>
-  void for_each_binding (BindingVisitor &v)
+  void for_each_binding (BindingVisitor &v) const
   {
     for (map_t::iterator iter = m_map.begin (); iter != m_map.end (); ++iter)
       {


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-01-14 20:30 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-14 20:30 [gcc r11-6689] analyzer: const fixes [PR98679] David Malcolm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).