[Bug c++/93490] -Wsuggest-attribute=const suggests const attribute for non-static member function

pinskia at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Wed Jan 29 17:08:00 GMT 2020


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

--- Comment #5 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>With "INLINE" defined there is no warning.

inline functions are not warned about in general.
E.g.
inline int &f(Class1 *a)
{
  return a->member_;
}

Also does not warn.


More information about the Gcc-bugs mailing list