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

            Bug ID: 122774
           Summary: The compiler ICEs when compiling a file that mixes a
                    module import with a traditional header include.
           Product: gcc
           Version: 15.2.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ComixHe1895 at outlook dot com
  Target Milestone: ---

Created attachment 62857
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=62857&action=edit
compiler log

The minimal reproducer:

main.cpp:
---------------------
import std;
#include <cstdio>

int main() {}
---------------------

CMakeLists.txt:
---------------------
cmake_minimum_required(VERSION 4.0)
set(CMAKE_EXPERIMENTAL_CXX_IMPORT_STD "d0edc3af-4c50-42ea-a356-e2862fe7a444")
set(CMAKE_CXX_STANDARD 26)
set(CMAKE_CXX_MODULE_STD 1)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_EXPORT_COMPILE_COMMANDS ON)

project(demo LANGUAGES CXX)
add_executable(demo main.cpp)
--------------------

Command line used:

    cmake -B build -GNinja && cmake --build build


Actual result:
The compiler crashes with an internal compiler error (log attached).

Expected result:
The compiler should accept this valid C++ code without crashing, or emit a
normal diagnostic instead of ICE.

Environment:
GCC:

Using built-in specs.
COLLECT_GCC=/usr/bin/gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-pc-linux-gnu/15.2.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: /build/gcc/src/gcc/configure
--enable-languages=ada,c,c++,d,fortran,go,lto,m2,objc,obj-c++,rust,cobol
--enable-bootstrap --prefix=/usr --libdir=/usr/lib --libexecdir=/usr/lib
--mandir=/usr/share/man --infodir=/usr/share/info
--with-bugurl=https://gitlab.archlinux.org/archlinux/packaging/packages/gcc/-/issues
--with-build-config=bootstrap-lto --with-linker-hash-style=gnu
--with-system-zlib --enable-__cxa_atexit --enable-cet=auto
--enable-checking=release --enable-clocale=gnu --enable-default-pie
--enable-default-ssp --enable-gnu-indirect-function --enable-gnu-unique-object
--enable-libstdcxx-backtrace --enable-link-serialization=1
--enable-linker-build-id --enable-lto --enable-multilib --enable-plugin
--enable-shared --enable-threads=posix --disable-libssp --disable-libstdcxx-pch
--disable-werror
Thread model: posix
Supported LTO compression algorithms: zlib zstd
gcc version 15.2.1 20251112 (GCC)

platform:

Latest ArchLinux x86_64

Reply via email to