bloomberg/clang-p2996

Implicit class members inconsistently returned by members_of

Closed this issue · 0 comments

Calling members_of currently returns different sets of implicit class member functions, depending on the uses of the class preceding the call. E.g.,

class S { };
static_assert(members_of(^S, std::meta::is_constructor).size() == 0);

S s;
static_assert(members_of(^S, std::meta::is_constructor).size() == 3);

There looks to be a Sema::ForceDeclarationOfImplicitMembers function which, if called from ensureInstantitated() in the members_of implementation, ought to ensure that all implicit members are present.