在C ++中,如果在其声明中初始化了成员引用,为什么它需要存储空间?

考虑这个例子。

struct S
{
    int j;
    inline static int i;
    int &ri{i};
};

S s;

static_assert(sizeof(s) > sizeof(int));

#include <type_traits>

static_assert(!std::is_standard_layout_v<S>);

( https://godbolt.org/z/vWFkBC ). The compiler reserves space for the reference within the class memory layout. I can't think of an example where a member reference which is initialized in its declaration would clearly be useful. Perhaps that is why compilers do not optimize for this case. Or, is there something in the Standard that prohibits optimizing out this reference?