https://gcc.gnu.org/bugzilla/show_bug.cgi?id=111923

--- Comment #11 from Stas Sergeev <stsp at users dot sourceforge.net> ---
So if I understand correctly, before
your proposal the following code was
conforming:

template <auto O>
struct B {
    static constexpr int off = O();
};

struct A {
    char a;
    B<[]() static constexpr ->int { return offsetof(A, b); }> b;
};

due to 7.1 (function body) + note4 for
closure sub-class.
Do you know any specific reason why that
code should be disallowed, rather than
supported per the current standard?
After reinterpret_cast is constexpr was
also disallowed, it became quite challenging
to come up with the work-around.

Reply via email to