This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: C++ PATCH for c++/91921 - stray warning with -Woverloaded-virtual


On 9/26/19 9:46 PM, Marek Polacek wrote:
  	  if (base_fndecl)
  	    {
  	      /* Here we know it is a hider, and no overrider exists.  */
-	      warning_at (location_of (base_fndecl),
-			  OPT_Woverloaded_virtual,
-			  "%qD was hidden", base_fndecl);
-	      warning_at (location_of (fns),
-			  OPT_Woverloaded_virtual, "  by %qD", fns);
+	      if (warning_at (location_of (base_fndecl),
+			      OPT_Woverloaded_virtual,
+			      "%qD was hidden", base_fndecl))
+		inform (location_of (fns), "  by %qD", fns);

I believe it's also customary to add an auto_diagnostic_group variable in these situations. OK with that change.

Jason


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]