public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base
@ 2004-02-04 13:38 Franck dot Vedrine at cea dot fr
  2004-02-04 14:19 ` [Bug c++/14017] " pinskia at gcc dot gnu dot org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Franck dot Vedrine at cea dot fr @ 2004-02-04 13:38 UTC (permalink / raw)
  To: gcc-bugs

Multiple inheritance does not execute correctly on the following code : it 
cores dump. It is specific on gcc 3.4. The code works fine on gcc 3.3

#include <iostream>

class Base {
  public:
   virtual ~Base() {}
   virtual int value() const { return 0; }
};

class FstDerived : public Base {
  public:
   virtual int _fst() const { return 1; }
   int fst() const { return _fst(); }
};

class SndDerived : public Base {
  public:
   virtual int _snd() const { return 2; }
   int snd() const { return _snd(); }
};

class Final : public FstDerived, public SndDerived {
  protected:
   virtual int _snd() const { return SndDerived::_snd() + 2; }
  public:
   int snd() const { return SndDerived::snd(); }
};

int main() {
   FstDerived* pfdFst = new Final();
   std::cout << ((const Final&) *pfdFst).snd() << std::endl;
};

-- 
           Summary: Problem on gcc 3.4 with multiple inheritance having a
                    common base
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: critical
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: Franck dot Vedrine at cea dot fr
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: gcc version 3.4.0 20040128 (prerelease)
  GCC host triplet: i686-pc-cygwin


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/14017] Problem on gcc 3.4 with multiple inheritance having a common base
  2004-02-04 13:38 [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base Franck dot Vedrine at cea dot fr
@ 2004-02-04 14:19 ` pinskia at gcc dot gnu dot org
  2004-02-04 15:29 ` bangerth at dealii dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-04 14:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-04 14:19 -------
gcc version 3.4.0 20040128 (prerelease)
Can you try again this version is old and there are have been changes since it and I cannot reproduce it.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |WAITING
  GCC build triplet|gcc version 3.4.0 20040128  |
                   |(prerelease)                |
   GCC host triplet|i686-pc-cygwin              |
 GCC target triplet|                            |i686-pc-cygwin
           Keywords|                            |wrong-code


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/14017] Problem on gcc 3.4 with multiple inheritance having a common base
  2004-02-04 13:38 [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base Franck dot Vedrine at cea dot fr
  2004-02-04 14:19 ` [Bug c++/14017] " pinskia at gcc dot gnu dot org
@ 2004-02-04 15:29 ` bangerth at dealii dot org
  2004-02-04 16:01 ` Franck dot Vedrine at cea dot fr
  2004-02-06 13:27 ` Franck dot Vedrine at cea dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: bangerth at dealii dot org @ 2004-02-04 15:29 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bangerth at dealii dot org  2004-02-04 15:29 -------
I can't reproduce this either with a 3.4 branch snapshot from 
2004-01-27. Please try again with a fresh installation. 
 
BTW: you didn't say which flags you used for compilation? 
 
W. 

-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/14017] Problem on gcc 3.4 with multiple inheritance having a common base
  2004-02-04 13:38 [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base Franck dot Vedrine at cea dot fr
  2004-02-04 14:19 ` [Bug c++/14017] " pinskia at gcc dot gnu dot org
  2004-02-04 15:29 ` bangerth at dealii dot org
@ 2004-02-04 16:01 ` Franck dot Vedrine at cea dot fr
  2004-02-06 13:27 ` Franck dot Vedrine at cea dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: Franck dot Vedrine at cea dot fr @ 2004-02-04 16:01 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Franck dot Vedrine at cea dot fr  2004-02-04 16:01 -------
It is probably a problem with my own installation of gcc on cygwin. When I will 
have time, I will try on a new installation of cygwin. I had this problem with 
many snapshots since December 2003 on a bigger application. I recently isolate 
it. I simply compile this test with g++ without options. The test is OK on 
linux (gcc 3.5).
I am currently compiling gcc 3.4/3.5 with gcc 3.3.1 and it takes time on cygwin 
to see the results.
Thanks for your answers.

-- 


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [Bug c++/14017] Problem on gcc 3.4 with multiple inheritance having a common base
  2004-02-04 13:38 [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base Franck dot Vedrine at cea dot fr
                   ` (2 preceding siblings ...)
  2004-02-04 16:01 ` Franck dot Vedrine at cea dot fr
@ 2004-02-06 13:27 ` Franck dot Vedrine at cea dot fr
  3 siblings, 0 replies; 5+ messages in thread
From: Franck dot Vedrine at cea dot fr @ 2004-02-06 13:27 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From Franck dot Vedrine at cea dot fr  2004-02-06 13:26 -------
Finally the code works fine with recent versions of gcc 3.4 and gcc 3.5. It was 
probably an installation problem. Sorry.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|WAITING                     |RESOLVED
         Resolution|                            |INVALID


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


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2004-02-06 13:27 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-04 13:38 [Bug c++/14017] New: Problem on gcc 3.4 with multiple inheritance having a common base Franck dot Vedrine at cea dot fr
2004-02-04 14:19 ` [Bug c++/14017] " pinskia at gcc dot gnu dot org
2004-02-04 15:29 ` bangerth at dealii dot org
2004-02-04 16:01 ` Franck dot Vedrine at cea dot fr
2004-02-06 13:27 ` Franck dot Vedrine at cea dot fr

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).