https://gcc.gnu.org/bugzilla/show_bug.cgi?id=126312
Guillaume Racicot <gufideg at gmail dot com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Component|middle-end |c++
--- Comment #1 from Guillaume Racicot <gufideg at gmail dot com> ---
Something happened when editing the text. Here's the full example without the
paragraph in the middle. Changed the component to be C++:
struct val_ref {
constexpr val_ref() : val(42), ref(val) {}
val_ref(val_ref&&) = delete;
val_ref(val_ref const&) = delete;
int val;
int& ref;
};
struct wrapper {
constexpr wrapper(): impl{} {}
val_ref impl{};
};
constexpr auto make_s() {
return wrapper{};
}
constexpr int test() {
auto s = make_s();
return s.impl.ref;
}
//static_assert(test());
int main() {
return test() == 42 ? 0 : 1;
}