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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |ppalka at gcc dot gnu.org
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2023-12-17

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
It works if we initialize the static data member out of line:

    export module A;

    export struct A
    {
        static const int blub;
    };

constexpr int A::blub = 42;


Maybe relatedly, we also ICE streaming out a non-trivially initialized static
inline data member:

    export module A;

    export struct A
    {
        static int f() { return -1; }
        static inline int blub = f();
    };

Reply via email to