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: PR 11493 and PR 11495


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?

> !       
> !       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.

Jason


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