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] |
On Wednesday 17 November 2004 10:39, Nathan Sidwell wrote:
Paul Brook wrote:
+ if (typeid(*catch_type) == typeid (typeid(void*))) + { + const __pointer_type_info *catch_pointer_type = + static_cast<const __pointer_type_info *> (catch_type); + const __pointer_type_info *throw_pointer_type = + static_cast<const __pointer_type_info *> (throw_type); + + if (typeid (*catch_pointer_type->__pointee) != typeid (void) + && (*catch_pointer_type->__pointee != + *throw_pointer_type->__pointee)) + return ctm_succeeded_with_ptr_to_base;
How is this return statement reachable? If catch_type is a pointer to void, how can the type of the thing it points to _not_ be void?
The first if should be asserting that *catch_type is the typeid of a pointer, ie. a __pointer_type_info.
Oh, I see the nested typeid's now. ug! I'd really like to see the example of why this is necessary.
-- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |