These member functions look like they could be marked const, since
they don't modify any (non-mutable) class members.
PR c++/98951
* call.c (struct z_candidate): Mark rewritten and reversed as const.
(struct NonPublicField): Mark operator() as const.
(struct NonTrivialField): Likewise.
/* The flags active in add_candidate. */
int flags;
- bool rewritten () { return (flags & LOOKUP_REWRITTEN); }
- bool reversed () { return (flags & LOOKUP_REVERSED); }
+ bool rewritten () const { return (flags & LOOKUP_REWRITTEN); }
+ bool reversed () const { return (flags & LOOKUP_REVERSED); }
};
/* Returns true iff T is a null pointer constant in the sense of
struct NonPublicField
{
- bool operator() (const_tree t)
+ bool operator() (const_tree t) const
{
return DECL_P (t) && (TREE_PRIVATE (t) || TREE_PROTECTED (t));
}
struct NonTrivialField
{
- bool operator() (const_tree t)
+ bool operator() (const_tree t) const
{
return !trivial_type_p (DECL_P (t) ? TREE_TYPE (t) : t);
}