24580 – [3.4/4.0/4.1 Regression] virtual base class cause exception not to be caught (original) (raw)
Description Drea Pinski 2005-10-29 16:38:30 UTC
The following code should not abort: struct vbase {};
struct foo : virtual vbase { foo() { throw "exception in foo ctor"; }
};
main() { struct bar : public foo {}; try { bar a; } catch ( ... ) { } return 0;
};
This is forwarded from: http://gcc.gnu.org/ml/gcc/2005-09/msg00253.html
Comment 2 Mark Mitchell 2005-10-31 06:43:43 UTC
Wrong-code; showstopper.
Comment 4 Jason Merrill 2005-11-14 20:23:31 UTC
Subject: Bug 24580
Author: jason Date: Mon Nov 14 20:23:25 2005 New Revision: 106902
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106902 Log: PR c++/24580 * method.c (locate_ctor): Skip all artificial parms, not just 'this'.
Added: branches/gcc-4_0-branch/gcc/testsuite/g++.dg/eh/synth2.C - copied unchanged from r106901, trunk/gcc/testsuite/g++.dg/eh/synth2.C Modified: branches/gcc-4_0-branch/gcc/cp/ChangeLog branches/gcc-4_0-branch/gcc/cp/method.c
Comment 5 Drea Pinski 2005-11-14 20:33:11 UTC
Fixed in 4.0.3.
Comment 6 Jason Merrill 2005-11-14 20:48:56 UTC
Subject: Bug 24580
Author: jason Date: Mon Nov 14 20:48:50 2005 New Revision: 106903
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106903 Log: PR c++/24580 * method.c (locate_ctor): Skip all artificial parms, not just 'this'.
Added: branches/gcc-3_4-branch/gcc/testsuite/g++.dg/eh/synth2.C - copied unchanged from r106901, trunk/gcc/testsuite/g++.dg/eh/synth2.C Modified: branches/gcc-3_4-branch/gcc/cp/ChangeLog branches/gcc-3_4-branch/gcc/cp/method.c
Comment 7 Drea Pinski 2005-11-14 20:52:09 UTC
Fixed also for 3.4.5.
Comment 8 Jason Merrill 2005-11-16 20:22:09 UTC
Subject: Bug 24580
Author: jason Date: Wed Nov 16 20:22:00 2005 New Revision: 107097
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107097 Log: PR c++/24580 * method.c (locate_copy): Also use skip_artificial_parms here. (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking for RECORD_TYPE. (locate_ctor): Abort if we fail to find a default constructor.
Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/method.c
Comment 9 Jason Merrill 2005-11-16 20:26:10 UTC
Subject: Bug 24580
Author: jason Date: Wed Nov 16 20:26:06 2005 New Revision: 107098
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107098 Log: PR c++/24580 * method.c (locate_copy): Also use skip_artificial_parms here. (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking for RECORD_TYPE.
Modified: branches/gcc-4_0-branch/gcc/cp/ChangeLog branches/gcc-4_0-branch/gcc/cp/method.c
Comment 10 Jason Merrill 2005-11-16 20:27:30 UTC
Subject: Bug 24580
Author: jason Date: Wed Nov 16 20:27:26 2005 New Revision: 107099
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=107099 Log: PR c++/24580 * method.c (locate_copy): Also use skip_artificial_parms here. (synthesize_exception_spec): Use CLASS_TYPE_P rather than checking for RECORD_TYPE.
Modified: branches/gcc-3_4-branch/gcc/cp/ChangeLog branches/gcc-3_4-branch/gcc/cp/method.c