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

            Bug ID: 105489
           Summary: Internal Compiler Error for 6 line source code (using
                    C++20 modules) doing nothing
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: sandipan.mohanty at gmail dot com
  Target Milestone: ---

Created attachment 52928
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=52928&action=edit
Preprocessed source generated by g++ -freport-bug

The following 6 line code defining a struct with only one member type causes an
ICE in GCC git version (4 May 2022 / 4a2061610726becfa5158e418c69800f5634b4c1):

// Start : Module_ICE_1.cc
module;
import <vector>;
export module SomeModule;
struct SomeClass {
    using iterator = std::vector<int>::iterator;
};
// End

Steps used to compile:

$ rm -rf gcm.cache
$ g++ -std=c++20 -fmodules-ts -xc++-system-header vector
$ g++ -std=c++20 -fmodules-ts -c Module_ICE_1.cc

Expected: (i) the module interface unit compiles without issues if code is
correct (ii) an error message from the compiler about what exactly is going
wrong, if the user code is incorrect

Not expected: compiler crash caused by 6 lines of user code.

Tested on: Reborn OS (Arch Linux), OpenSuSE 15.3, Kubuntu 22.04, Rocky Linux
(RHEL/CentOS/Fedora)

The release version of GCC 11.2.0 does not have this ICE. 

The configuration options used to build GCC were:

../configure --prefix=blah --enable-languages=c,c++,fortran --disable-multilib
--enable-optimized --enable-linux-futex

I can do additional experiments if it will help detect/resolve this issue.

Reply via email to