www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1998/10/24/16:13:00

Message-Id: <199810242110.VAA07332@out5.ibm.net>
From: "Mark E." <snowball3 AT usa DOT net>
To: djgpp-workers AT delorie DOT com
Date: Sat, 24 Oct 1998 17:11:23 +0000
MIME-Version: 1.0
Subject: another egcs 1.1 DJGPP eh test case
X-mailer: Pegasus Mail for Windows (v3.01b)
Reply-To: djgpp-workers AT delorie DOT com

This test case is based on a previous case by Andris Pavenis. 
This 
affects DJGPP (i386-pc-msdosdjgpp).

In the test case below, throwing an 'empty' class results in an 
abort. But
when a do-nothing constructor and destructor are added to the 
class, the
exception is properly catched.

#include <iostream>

// Test example for exceptions problem with DJGPP port of egcs-
1.1

// If the next line is uncommented, the exception is catched;
// otherwise, throwing the exception causes an abort in egcs's 
copy_reg

//#define USERDEF_XTORS

class xx {
#ifdef USERDEF_XTORS
public:
  xx() {}
  ~xx() {}
#endif
};

void x2 (void)
{
  xx a;
  throw(a);
}

int main (void)
{
  try { x2(); } catch (xx& w) { cout << "catched from x2()\n"; }
  cout << "----------------\n";
  return 0;
}


-- 
Mark E. snowball3 AT usa DOT net
http://members.xoom.com/snowball3/

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019