cppfront icon indicating copy to clipboard operation
cppfront copied to clipboard

UFCS of qualified base function needs Cpp1 reflection

Open JohelEGP opened this issue 1 year ago • 0 comments
trafficstars

          > Calling the member of a base type.

But all reject the UFCS macro on this (https://compiler-explorer.com/z/fe3j4ex9Y, https://cpp2.godbolt.org/z/xKT6dzTjr):

namespace N {
struct B {
  void f();
};
}
struct D : N::B { };
void g() {
  D d;
  d.B::f(); // OK.
  static_cast<void>(
    [&](auto&& obj) {
      if constexpr (requires { obj.B::f(); })
        return obj.B::f();
      else
        return B::f(obj); // Error: No `B`.
    }
  );
}

Originally posted by @JohelEGP in https://github.com/hsutter/cppfront/issues/746#issuecomment-1760469872

JohelEGP avatar Nov 24 '23 18:11 JohelEGP