tree F = TREE_TYPE (r);
F = build_pointer_type (F);
F = build_ptrmemfunc_type (F);
- if (same_type_p (T, F))
+ if (same_type_p (T, F) || fnptr_conv_p (T, F))
return true;
return false;
}
{
tree F = TREE_TYPE (r);
F = build_pointer_type (F);
- if (same_type_p (T, F))
+ if (same_type_p (T, F) || fnptr_conv_p (T, F))
return true;
return false;
}
const tsubst_flags_t complain = complain_flags (ctx);
if (POINTER_TYPE_P (T))
- return cp_build_addr_expr (r, complain);
+ {
+ r = cp_build_addr_expr (r, complain);
+ return perform_implicit_conversion (T, r, complain);
+ }
else
{
if (!mark_used (r, complain))
constexpr auto a5 = extract<int (*)(B)>(^^B::fn5);
constexpr auto a6 = extract<int (B::*)(int) &>(^^B::fn6);
constexpr auto a7 = extract<int (B::*)(int) &&>(^^B::fn7);
-
constexpr auto a8 = extract<int B::*>(^^B::m);
constexpr auto a9 = extract<int const B::*>(^^B::m);
constexpr auto a10 = extract<int* B::*>(^^B::p);
constexpr auto a11 = extract<int* const B::*>(^^B::p);
constexpr auto a12 = extract<int const* const B::*>(^^B::p);
-
-// FIXME removing noexcept should be allowed
-// constexpr auto a13 = extract<int (*)()>(^^B::fn4);
-// constexpr auto a14 = extract<int (B::*)()>(^^B::fn2);
+constexpr auto a13 = extract<int (*)()>(^^B::fn4);
+constexpr auto a14 = extract<int (B::*)()>(^^B::fn2);
};
static_assert (!can_extract<void (C::*)()>(^^C::fn));
static_assert (!can_extract<int (C::*)() noexcept>(^^C::fn));
-static_assert (!can_extract<int (C::*)()>(^^C::fn2));
+static_assert (can_extract<int (C::*)()>(^^C::fn2));
static_assert (!can_extract<int (C::*)()>(^^C::fn3));
static_assert (!can_extract<int (C::*)()>(^^C::fn4));
static_assert (!can_extract<int (*)() noexcept>(^^C::fn3));
-static_assert (!can_extract<int (*)()>(^^C::fn4));
+static_assert (can_extract<int (*)()>(^^C::fn4));
static_assert (!can_extract<int (*)()>(^^C::fn5));
static_assert (!can_extract<int (C::*)(int) &&>(^^C::fn6));
static_assert (!can_extract<int (C::*)(int) &>(^^C::fn7));