Simon Martin - Re: Fix PR c++/14622: Type mismatch in explicit template instantiation n (original) (raw)
This is the mail archive of the gcc-patches@gcc.gnu.orgmailing 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] |
- From: Simon Martin
- To: Mark Mitchell
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 6 Feb 2007 22:36:22 +0100
- Subject: Re: Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
- References: <200702042229.06700.simartin@users.sourceforge.net> <45C6B6DC.9060203@codesourcery.com>
Hi Mark.
Comparisons of types using pointer-equality are almost always wrong; you have to use same_type_p. Oops. Thanks a lot for pointing this out!
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? 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)); (Could be in a single call to error if you prefer)
(Why did you use %q#D instead of just %qD?) I used it because it would show "B A::a" instead of just "A::a", which I thought made the error message clearer. However, it's of no use now that the types are explicited.
OK with those changes. I'll wait for your feedback on the error message before resubmitting.
Thanks in advance, Simon
- Follow-Ups:
- Re: Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
* From: Mark Mitchell
- Re: Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
- References:
- Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
* From: Simon Martin - Re: Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
* From: Mark Mitchell
- Fix PR c++/14622: Type mismatch in explicit template instantiation not detected
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |