[Bug analyzer/98679] Four functions could be marked "const".

2021-01-14 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98679

David Malcolm  changed:

   What|Removed |Added

 Status|ASSIGNED|RESOLVED
 Resolution|--- |FIXED

--- Comment #4 from David Malcolm  ---
Should be fixed by the above commit.

[Bug analyzer/98679] Four functions could be marked "const".

2021-01-14 Thread cvs-commit at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98679

--- Comment #3 from CVS Commits  ---
The master branch has been updated by David Malcolm :

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

commit r11-6689-g8a18261afd923151b8d2a37f667e4673b27acd3f
Author: David Malcolm 
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.

[Bug analyzer/98679] Four functions could be marked "const".

2021-01-14 Thread dmalcolm at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98679

David Malcolm  changed:

   What|Removed |Added

 Status|NEW |ASSIGNED

--- Comment #2 from David Malcolm  ---
Thanks.  Am testing a fix.

[Bug analyzer/98679] Four functions could be marked "const".

2021-01-14 Thread redi at gcc dot gnu.org via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98679

Jonathan Wakely  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Last reconfirmed||2021-01-14
 Status|UNCONFIRMED |NEW

--- Comment #1 from Jonathan Wakely  ---
(In reply to David Binderman from comment #0)
> 1.
> 
> trunk.git/gcc/analyzer/analyzer.h:172:8: style:inconclusive: Technically the
> member function 'ana::region_offset::operator==' can be const.
> [functionConst]

This should absolutely be const. Comparison operators that don't work with
const objects are broken.

> 
> 2.
> 
> trunk.git/gcc/analyzer/pending-diagnostic.h:160:8: style:inconclusive:
> Technically the member function 'ana::pending_diagnostic::equal_p' can be
> const. [functionConst]

The same argument applies here since it's effectively operator==.