This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: C++ PATCH: PR 11493 and PR 11495
- From: Jason Merrill <jason at redhat dot com>
- To: mark at codesourcery dot com
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 14 Jul 2003 14:39:14 -0400
- Subject: Re: C++ PATCH: PR 11493 and PR 11495
- References: <200307140307.h6E37aFa017684@sirius.codesourcery.com>
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