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

            Bug ID: 120414
           Summary: ICE in module serialization - bad file data
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cjangus at gmail dot com
  Target Milestone: ---

Minimal repro:

// m-part.mxx
export module m:part;

template < int n >
struct Base
{
        static constexpr auto base_static_mbr_n = n;
};

template < int n >
struct Derived : Base< n >
{
        using Base< n >::base_static_mbr_n;

        template < int n2 >
                requires (n2 <= base_static_mbr_n)
        Derived()
        {}
};

struct S
{
    Derived< 1 > data;
};


// m.mxx
export module m;

export import :part;


Commands:
g++ -fPIC -Og -g -Wall std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
m-part.mxx
g++ -fPIC -Og -g -Wall std=c++2b -fmodules -finput-charset=UTF-8 -c -x c++
m.mxx


Output:
In module imported at ~/m.mxx:3:8:
m:part: error: failed to read compiled module cluster 5: Bad file data
m:part: note: compiled module file is ‘~/m-part.gcm’
m:part: error: failed to read compiled module: Bad file data
m:part: fatal error: returning to the gate for a mechanical issue


Build:
Target: x86_64-pc-linux-gnu
Configured with: ../repo/configure --prefix=/home/cjangus/gcc
--enable-languages=c,c++ --disable-multilib
gcc version 16.0.0 20250522 (experimental) (GCC)

Reply via email to