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: Unreviewed C++ patch


Gabriel Dos Reis wrote:

>> [PR7841] Fix invalid name of constructor
>> http://gcc.gnu.org/ml/gcc-patches/2004-04/msg01197.html
>
> Since you detect the problem and know about what is going on, the
> error message
>
>   error: invalid use of argument list for a constructor in a
> qualified name
>
> is a bit unclear.  What about
>
>   error: invalid use of constructor 'X<dim>::X' as a template
>
> ?

Sure, but I kept the inform() so I don't name the expression in the diagnostic.
I'm committing this (given also Mark's approval):

      error ("invalid use of constructor as a template");
      inform ("use `%T::%D' instead of `%T::%T' to name the "
       "constructor in a qualified name", class_type,
       DECL_NAME (TYPE_TI_TEMPLATE (class_type)),
       class_type, class_type);

> We should also reject the follwoing
>
>     X<dim>::X<dim>  x;
>
> and
>
>    struct A { };
>    A::A a;

This is different though. I filed PR 15865 to track this.

Giovanni Bajo



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