User account creation filtered due to spam.

Bug 24580 - [3.4/4.0/4.1 Regression] virtual base class cause exception not to be caught
Summary: [3.4/4.0/4.1 Regression] virtual base class cause exception not to be caught
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P1 normal
Target Milestone: 3.4.5
Assignee: Jason Merrill
URL:
Keywords: wrong-code
Depends on:
Blocks:
 
Reported: 2005-10-29 16:38 UTC by Andrew Pinski
Modified: 2005-11-14 20:52 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 2.95.3
Known to fail: 3.0.4 3.4.0 4.0.0 3.3.3 3.2.3
Last reconfirmed: 2005-11-13 16:34:49


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew 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 1 Andrew Pinski 2005-10-29 16:42:45 UTC
Confirmed as a bug in:
http://gcc.gnu.org/ml/gcc/2005-09/msg00329.html
Comment 2 Mark Mitchell 2005-10-31 06:43:43 UTC
Wrong-code; showstopper.
Comment 3 Jason Merrill 2005-11-14 20:07:51 UTC
Subject: Bug 24580

Author: jason
Date: Mon Nov 14 20:07:45 2005
New Revision: 106901

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=106901
Log:
        PR c++/24580
        * method.c (locate_ctor): Skip all artificial parms, not just
        'this'.

Added:
    trunk/gcc/testsuite/g++.dg/eh/synth2.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/method.c

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 Andrew 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 Andrew 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