C++ PATCH: PR 11493 and PR 11495

Mark Mitchell mark@codesourcery.com
Mon Jul 14 18:54:00 GMT 2003


On Mon, 2003-07-14 at 11:39, Jason Merrill wrote:
> On Sun, 13 Jul 2003 20:07:36 -0700, Mark Mitchell <mark@codesourcery.com> wrote:
> 
> > !       /* In a template, it is invalid to write "f()" or "f(3)" if no
> > ! 	 declaration of "f" is available.  Historically, G++ and most
> > ! 	 other compilers accepted that usage; explain to the user what
> > ! 	 is going wrong.  */
> > !       (flag_permissive ? warning : error)
> > ! 	("there are no arguments to `%D' that depend on a template "
> > ! 	 "parameter, so a declaration of `%D' must be available", name,
> > ! 	 name);
> 
> Why not just use pedwarn?

Because I got tangled in the whole -pedantic, -pedantic-errors,
-fpermissive, 'if (pedantic) pedwarn (...)' thing. :-(

I'll make that change.

> > !       
> > !       if (!flag_permissive)
> >   	{
> > ! 	  static bool hint;
> > ! 	  if (!hint)
> > ! 	    {
> > ! 	      error ("(if you use `-fpermissive', G++ will accept your code, "
> > ! 		     "but allowing the use of an undeclared name is "
> > ! 		     "deprecated)");
> > ! 	      hint = true;
> 
> It would be nice to give this sort of message for any pedwarn; I suppose
> that would mean moving flag_permissive into diagnostic.c.

Now that flag_permissive just turns off -pedantic-errors, it would
probably be easier than that.

-- 
Mark Mitchell <mark@codesourcery.com>
CodeSourcery, LLC



More information about the Gcc-patches mailing list