[patch] Fix PR c++/19439

Lee Millward lee.millward@codesourcery.com
Sat Jan 6 01:08:00 GMT 2007


On 12/28/06, Mark Mitchell <mark@codesourcery.com> wrote:
>
> :REVIEWMAIL: OK
>
> I was nervous about this patch because I suspected that with the patch
> we'll warn twice about duplicates in templates: first when declaring the
> class, and again when instantiating it.
>
> The problem is that it's hard to avoid warning when instantiating.
> There's no way to know if:
>
>   template <typename T>
>   struct S {
>     void f(int);
>     void f(T);
>   };
>
> contains a duplicate until we know what "T" is -- anything but
> cv-qualified "int" is OK.
>
> However, it looks like your patch will be OK because you will only error
> out on the uninstantiated template if the method is definitely a
> duplicate, and then we'll not add the function to the class, and so
> we'll not get another error upon instantiation.
>
> Thanks,
>
> --
> Mark Mitchell
> CodeSourcery
> mark@codesourcery.com
> (650) 331-3385 x713
>

Applied to mainline after a re-bootstrap and regression tested successfully.

Cheers,
Lee.



More information about the Gcc-patches mailing list