Skip to content

UFCS of qualified base function needs Cpp1 reflection #855

Open

Description

@JohelEGP
          > 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 #746 (comment)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions