This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/81013] New: [7/8 Regression] ICE with invalid union in class hierarchy


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

            Bug ID: 81013
           Summary: [7/8 Regression] ICE with invalid union in class
                    hierarchy
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Keywords: error-recovery, ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following invalid code snippet triggers an ICE since GCC 7.1.0:

=====================================
struct A
{
  virtual void foo() const;
};

union B : A
{
  void foo() const;
};

void bar(const B& b)
{
  b.foo();
}
=====================================

bug.cc:6:11: error: derived union 'B' invalid
 union B : A
           ^
during GIMPLE pass: *build_cgraph_edges
bug.cc: In function 'void bar(const B&)':
bug.cc:11:6: internal compiler error: in create_indirect_edge, at cgraph.c:962
 void bar(const B& b)
      ^~~
0x96667b cgraph_node::create_indirect_edge(gcall*, int, profile_count, int,
bool)
        ../../gcc/gcc/cgraph.c:962
0x96bd2c execute
        ../../gcc/gcc/cgraphbuild.c:341
Please submit a full bug report, [etc.]

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]