incorrect C++ EH tests in egcs tree
Jonathan Schilling
jls@sco.com
Wed Mar 31 23:46:00 GMT 1999
> From martin@mira.isdn.cs.tu-berlin.de Mon Mar 22 15:34:21 1999
>
> [referring to the new2.C C++ EH test]
>
> I agree that the test case is bogus. Your modification test a slightly
> different feature, though, so I propose a different fix.
>
> Just initialize newed after main enters.
>
> int main ()
> {
> newed = created = 0;
> try {
> foo (new B (A ()));
> } catch (...) { }
>
> return !(!newed && !created);
> }
>
> Would this work as well?
Yes, this works. (The one I proposed is better programming style,
since replacing the global operator new and delete tends to run into
just these kinds of problems with the replacements being called in
unexpected contexts, but test cases need not be concerned with style.)
Jonathan Schilling SCO, Inc. jls@sco.com
More information about the Gcc
mailing list