Starting with C++17 the noexcept is part of the function signature but a noexcept function can be converted to a noexcept(false) function. The overload resolution code handles it properly but expression builder doesn't. It causes the following code to trigger and assertion failure:
struct S { int f(void) noexcept { return 110; } } s; template <int(S::*a)(void)> int f10(void) { return (s.*a)(); } int foo(void) { return f10<&S::f >(); }
The fix adds an extra implicit cast when needed. I picked the CK_NoOp as CastKind since it seems to be the best fit. However I wonder whether it would be better to add a new value CK_FunctionPointerConversion.
This fixes bug 40024.
Please capitalize local variable names to match the local convention.