-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
Full name of submitter (unless configured in github; will be published with the issue): Hubert Tong
Reference (section label): [expr.prim.id.general]
Link to reflector thread (if any): N/A
Issue description:
https://wg21.link/expr.prim.id.general#3 leaves the meaning of id-expressions that denote function members of namespace-scope anonymous unions in a black hole as the applicable bullet assumes that a member of an anonymous union variable is necessarily a data member.
Special member functions of an anonymous union type are observable via reflection, however, implementations are still behind (https://godbolt.org/z/T5GTqcx58):
#include <meta>
using namespace std::meta;
static union { int x; };
constexpr info anon_union = parent_of(^^x);
static_assert(is_type(anon_union));
using AnonUnion = [:anon_union:];
using AUOpAssignType = AnonUnion &(AnonUnion &&);
using AUOpAssignMPTy = AUOpAssignType AnonUnion::*;
namespace idexpr {
AUOpAssignMPTy aumemptr = &AnonUnion::operator=;
}
namespace extractcall {
constexpr info au_mem = members_of(anon_union, access_context::unchecked())[5];
//static_assert(0, display_string_of(au_mem));
auto aumemptr = extract<AUOpAssignMPTy>(au_mem);
}Suggested resolution:
Scope the subject paragraph to apply only to id-expressions denoting data members.
Metadata
Metadata
Assignees
Labels
No labels