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

            Bug ID: 80831
           Summary: internal compiler error: Segmentation fault with
                    -fsyntax-only
           Product: gcc
           Version: 7.1.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: holger.hopp at sap dot com
  Target Milestone: ---

Following code throws internal compiler error: Segmentation fault with
g++ -c t.cpp --std=c++11 -fsyntax-only

(gcc Releases 6 and 7, gcc 5 is ok)


class A
{
public:
    virtual ~A() { }
};

class B { };

class C : public A { };

template<class J>
class D : public C
{
public:
    D() { }
    ~D() { }
};

class E
{
public:
    static E& p();
    B q();
    template<class J>
    B q(void (J::*r)())
    {
        new D<J>();
        return q();
    }
};

void t()
{
  class F
  {
  public:
    virtual void s() { }
  };
  E& x = E::p();
  B y = x.q(&F::s);
}


$ g++ -c t.cpp --std=c++11 -fsyntax-only
t.cpp:41:1: internal compiler error: Segmentation fault
 }
 ^
0xb045cf crash_signal
        <MYPATH>/gcc/gnu/gcc-7-branch/gcc/gcc/toplev.c:337
0x642c4c c_parse_final_cleanups()
        <MYPATH>/gcc/gnu/gcc-7-branch/gcc/gcc/cp/decl2.c:4710
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Reply via email to