diff options
author | David Malcolm <dmalcolm@redhat.com> | 2021-01-14 15:25:27 -0500 |
---|---|---|
committer | David Malcolm <dmalcolm@redhat.com> | 2021-01-14 15:25:27 -0500 |
commit | 8a18261afd923151b8d2a37f667e4673b27acd3f (patch) | |
tree | 6f694cd7f8f819521c839f1740872fa5f4a251d5 /gcc/analyzer | |
parent | f6ffd449e0cc9f40943cb45f6941628d0e192ab2 (diff) | |
download | gcc-8a18261afd923151b8d2a37f667e4673b27acd3f.zip gcc-8a18261afd923151b8d2a37f667e4673b27acd3f.tar.gz gcc-8a18261afd923151b8d2a37f667e4673b27acd3f.tar.bz2 |
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.
Diffstat (limited to 'gcc/analyzer')
-rw-r--r-- | gcc/analyzer/analyzer.h | 2 | ||||
-rw-r--r-- | gcc/analyzer/pending-diagnostic.h | 2 | ||||
-rw-r--r-- | 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 f603802..6996092 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 79dc83e..571fc1b 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 366439c..2bcef6c 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) { |