Re: [PATCH 2/2] [C++] pr31397 - implement -Wsuggest-override

2014-12-18 Thread Trevor Saunders
On Wed, Dec 17, 2014 at 04:21:31PM -0500, Jason Merrill wrote: > On 11/27/2014 01:28 AM, tsaund...@mozilla.com wrote: > >+ if (warn_override && DECL_VIRTUAL_P (decl) && !DECL_OVERRIDE_P (decl) > > Why check DECL_VIRTUAL_P here? I think it was to avoid warning when decl is hiding a non virtua

Re: [PATCH 2/2] [C++] pr31397 - implement -Wsuggest-override

2014-12-17 Thread Jason Merrill
On 11/27/2014 01:28 AM, tsaund...@mozilla.com wrote: + if (warn_override && DECL_VIRTUAL_P (decl) && !DECL_OVERRIDE_P (decl) Why check DECL_VIRTUAL_P here? + warning_at(DECL_SOURCE_LOCATION (decl), OPT_Wsuggest_override, Space before the (. Jason

[PATCH 2/2] [C++] pr31397 - implement -Wsuggest-override

2014-11-26 Thread tsaunders
From: Trevor Saunders Hi, the idea in the pr of providing a warning that tells people where they can add override seems reasonable to me. bootstrapped + regtested x86_64-unknown--linux-gnu (new test passes), ok? Trev c-family/ * c.opt (Wsuggest-override): New option. cp/ *