@@ -105,45 +105,6 @@ __function_type_info::~__function_type_info()
105105{
106106}
107107
108- // __qualified_function_type_info
109-
110- __qualified_function_type_info::~__qualified_function_type_info ()
111- {
112- }
113-
114- // Determine if a function pointer conversion can convert a pointer (or pointer
115- // to member) to type x into a pointer (or pointer to member) to type y.
116- static bool is_function_pointer_conversion (const std::type_info* x,
117- const std::type_info* y)
118- {
119- const unsigned int discardable_quals =
120- __qualified_function_type_info::__noexcept_mask |
121- __qualified_function_type_info::__transaction_safe_mask |
122- __qualified_function_type_info::__noreturn_mask;
123-
124- // If x has only discardable qualifiers and y is unqualified, then
125- // conversion is permitted.
126- const __qualified_function_type_info* qual_x =
127- dynamic_cast <const __qualified_function_type_info *>(x);
128- if (!qual_x)
129- return false ;
130- if ((qual_x->__qualifiers & ~discardable_quals) == 0 &&
131- is_equal (qual_x->__base_type , y, false ))
132- return true ;
133-
134- // Otherwise, x's qualifiers must be the same as y's, plus some discardable
135- // ones.
136- const __qualified_function_type_info* qual_y =
137- dynamic_cast <const __qualified_function_type_info *>(y);
138- if (!qual_y)
139- return false ;
140- if (qual_y->__qualifiers & ~qual_x->__qualifiers )
141- return false ;
142- if (qual_x->__qualifiers & ~qual_y->__qualifiers & ~discardable_quals)
143- return false ;
144- return is_equal (qual_x->__base_type , qual_y->__base_type , false );
145- }
146-
147108// __enum_type_info
148109
149110__enum_type_info::~__enum_type_info ()
@@ -429,15 +390,13 @@ __pointer_type_info::can_catch(const __shim_type_info* thrown_type,
429390 // Do the dereference adjustment
430391 if (adjustedPtr != NULL )
431392 adjustedPtr = *static_cast <void **>(adjustedPtr);
432- // bullet 3B
433- if (thrown_pointer_type->__flags & ~__flags)
393+ // bullet 3B and 3C
394+ if (thrown_pointer_type->__flags & ~__flags & __no_remove_flags_mask)
395+ return false ;
396+ if (__flags & ~thrown_pointer_type->__flags & __no_add_flags_mask)
434397 return false ;
435398 if (is_equal (__pointee, thrown_pointer_type->__pointee , false ))
436399 return true ;
437- // bullet 3C
438- if (is_function_pointer_conversion (thrown_pointer_type->__pointee ,
439- __pointee))
440- return true ;
441400 // bullet 3A
442401 if (is_equal (__pointee, &typeid (void ), false )) {
443402 // pointers to functions cannot be converted to void*.
@@ -543,11 +502,11 @@ bool __pointer_to_member_type_info::can_catch(
543502 dynamic_cast <const __pointer_to_member_type_info*>(thrown_type);
544503 if (thrown_pointer_type == 0 )
545504 return false ;
546- if (thrown_pointer_type->__flags & ~__flags)
505+ if (thrown_pointer_type->__flags & ~__flags & __no_remove_flags_mask)
506+ return false ;
507+ if (__flags & ~thrown_pointer_type->__flags & __no_add_flags_mask)
547508 return false ;
548- if (!is_equal (__pointee, thrown_pointer_type->__pointee , false ) &&
549- !is_function_pointer_conversion (thrown_pointer_type->__pointee ,
550- __pointee))
509+ if (!is_equal (__pointee, thrown_pointer_type->__pointee , false ))
551510 return false ;
552511 if (is_equal (__context, thrown_pointer_type->__context , false ))
553512 return true ;
0 commit comments