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++/31027] [4.1/4.2/4.3 regression] Compiler segfaults in simple virtual inheritance situation



------- Comment #4 from bangerth at dealii dot org  2007-03-09 04:54 -------
Confirmed. This is a regression introduced in 4.0.x.

Somewhat shorter:
----------------
struct A {};

template<typename T>
struct C: virtual A {
    C() {};
    template<typename T_OTHER> C(const C<T_OTHER>&) {};
    C func(const class C<long>&) const;
    operator bool()const;
};

template<typename T>
struct D: C<T> {
    void func2() {
      C<int>a;
      a.func(a);
    }
};

void func3() {
  C<int>a;
  a.func(a);
}
--------------------

g/x> c++ -c x.cc
x.cc: In constructor 'C<T>::C(const C<T_OTHER>&) [with T_OTHER = int, T = long
int]':
x.cc:21:   instantiated from here
x.cc:6: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://www.suse.de/feedback> for instructions.


The funny thing is that we need to keep the class template D around, even
though it is completely unused...

W.


-- 

bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bangerth at dealii dot org
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|0                           |1
           Keywords|rejects-valid               |ice-on-valid-code
   Last reconfirmed|0000-00-00 00:00:00         |2007-03-09 04:54:24
               date|                            |
            Summary|Compiler segfaults in simple|[4.1/4.2/4.3 regression]
                   |virtual inheritance         |Compiler segfaults in simple
                   |situation                   |virtual inheritance
                   |                            |situation


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31027


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