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

            Bug ID: 118630
           Summary: [modules] ICE in sort_cluster when streaming
                    decltype(lambda) return type
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nshead at gcc dot gnu.org
            Blocks: 103524
  Target Milestone: ---

The following sample:

  export module M;
  template <typename> decltype([]{}) f();

ICEs on current trunk when compiled with 'g++ -fmodules -std=c++20'.

It hits the checking-only assertion here (added in r15-4861):

--- a/gcc/cp/module.cc
+++ b/gcc/cp/module.cc
@@ -14909,21 +14909,21 @@ sort_cluster (depset::hash *original, depset *scc[],
unsigned size)
     {
       gcc_checking_assert (order[ix]->is_special ());
       bool tight = order[ix]->cluster == cluster;
       depset *dep = order[ix]->deps[0];
       dump (dumper::MERGE)
         && dump ("Mergeable %u is %N%s%s", ix, dep->get_entity (),
                  tight ? " (tight)" : "", dep->is_entry () ? " (entry)" : "");
       scc[ix] = dep;
       if (tight)
         {
!          gcc_checking_assert (dep->is_maybe_recursive ());
           if (dep->is_entry ())
             {
               /* There should only be one entry dep in a cluster.  */
               gcc_checking_assert (!scc[entry_pos]->is_entry ());
               gcc_checking_assert (scc[entry_pos]->is_maybe_recursive ());
               scc[ix] = scc[entry_pos];
               scc[entry_pos] = dep;
             }
         }
       else

Without this assertion failure streaming seems to proceed correctly for this
specific case, but it's indicative of a potential underlying issue.


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103524
[Bug 103524] [meta-bug] modules issue

Reply via email to