lock3 / meta

122 stars 11 forks source link

Reflecting and unreflecting a data member causes compiler crash #307

Open matus-chochlik opened 3 years ago

matus-chochlik commented 3 years ago

include <experimental/compiler>

include <experimental/meta>

struct S { int i{0}; }

consteval auto reflect_S_i() { using namespace std::experimental::meta; return *members_of(^S, is_data_member).begin(); };

auto main() -> int { S s{}; const auto mp = &([: reflect_S_i() :]); (s.*mp) = 1; return 0; }