[PATCH] [libc++abi] Disallow conversions from function pointers to void*.
David Majnemer
david.majnemer at gmail.com
Fri Apr 3 21:58:44 PDT 2015
================
Comment at: test/catch_member_function_pointer_01.pass.cpp:71-86
@@ +70,18 @@
+ assert(!can_convert<dmf2>((mf1)0));
+ try
+ {
+ throw (mf1)0;
+ assert(false);
+ }
+ catch (dmf2)
+ {
+ assert(false);
+ }
+ catch (dmf1)
+ {
+ }
+ catch (...)
+ {
+ assert(false);
+ }
+
----------------
The implication of this test is that an exception of type 'void (A::*)()' can be caught as a 'void (B::*)()'. That doesn't seem right as only the standard pointer conversions are permitted ([except.handle]p3b1 references [conv.ptr] directly).
Pointer to member conversions are separate and described in [conv.mem]p2.
http://reviews.llvm.org/D8811
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list