This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
Simon Martin wrote:
I apologize for not having gotten back to you about this more quickly.
>> Also, the error message should mention the types. For example:
>>
>> error ("type %qT for explicit instantiation %qD does not match
>> declared type %qT", TREE_TYPE (result), TREE_TYPE (decl), decl);
> Ok. Just to be sure, the correct "order" is TREE_TYPE (result), decl and then
> TREE_TYPE (decl), right? Or should I swap the TREE_TYPEs?
Yes, you're right, of course.
> What do you think about this other possibility:
> error ("invalid type for explicit instanciation %qD", decl);
> error (" expected %qT, got %qT", TREE_TYPE (result), TREE_TYPE (decl));
That's a fine idea. I slightly prefer my version, but I'd approve
either. I do think a single call to error is better, and you need to
spell-check "instantiation". :-)
Thanks,
--
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713