This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
c++/105: Re: Bug in exception handling and virtual inheritance
- To: gcc-gnats at sourceware dot cygnus dot com
- Subject: c++/105: Re: Bug in exception handling and virtual inheritance
- From: "Martin v. Loewis" <martin at loewis dot home dot cs dot tu-berlin dot de>
- Date: Tue, 14 Mar 2000 10:07:25 +0100
- References: <00031313585000.01880@odisea.home.ma.es>
- Resent-Cc: gcc-prs at gcc dot gnu dot org, rafa at dedalo-ing dot com
- Resent-Reply-To: gcc-gnats@gcc.gnu.org, "Martin v. Loewis" <martin@loewis.home.cs.tu-berlin.de>
>Number: 105
>Category: c++
>Synopsis: Bug in exception handling and virtual inheritance
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: analyzed
>Class: wrong-code
>Submitter-Id: net
>Arrival-Date: Tue Mar 14 01:26:00 PST 2000
>Closed-Date:
>Last-Modified:
>Originator: Rafael Jesus Alcantara Perez <rafa@dedalo-ing.com>
>Release: 2.95.2
>Organization:
>Environment:
>Description:
Date: Mon, 13 Mar 2000 13:56:32 +0100
Original-Message-Id: <00031313585000.01880@odisea.home.ma.es>
[code crashes when catching exceptions involving virtual inheritance
- MvL]
>How-To-Repeat:
#include <string>
#include <iostream>
class TA
{
protected:
std::string yMessage;
public:
TA (void) :
yMessage()
{
cerr << this << ":\tTA::TA (void)\n";
}
TA (const char* pkcSOURCE) :
yMessage (pkcSOURCE)
{
cerr << this << ":\tTA::TA (" << pkcSOURCE << ")\n";
}
TA (const TA& rktSOURCE) :
yMessage (rktSOURCE.yMessage)
{
cerr << this << ":\tTA::TA[C] (" << yMessage << ")\n";
}
~TA (void)
{
cerr << this << ":\t~TA::TA (" << yMessage << ")\n";
}
std::string what (void) const
{
return yMessage;
}
}; // class TA
class TB1 : public virtual TA {};
class TB2 : public virtual TA {};
class TC :
public virtual TA ,
public TB1 ,
public TB2
{
public:
TC (const char* pkcSOURCE) :
TA (pkcSOURCE) ,
TB1 () ,
TB2 () {}
}; // class TC
int main (void)
{
try
{
throw TC ("TC");
}
catch (const TA& rktSOURCE_EXCEPTION)
{
;
}
return 0;
} // main()
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: