Commit 63752e29 by Jason Merrill Committed by Jason Merrill

re PR c++/24580 (virtual base class cause exception not to be caught)

        PR c++/24580
        * method.c (locate_ctor): Skip all artificial parms, not just
        'this'.

From-SVN: r106901
parent 85206901
2005-11-14 Jason Merrill <jason@redhat.com>
PR c++/24580
* method.c (locate_ctor): Skip all artificial parms, not just
'this'.
2005-11-14 Mark Mitchell <mark@codesourcery.com> 2005-11-14 Mark Mitchell <mark@codesourcery.com>
* parser.c (eof_token): Add initializer for ambiguous_p. * parser.c (eof_token): Add initializer for ambiguous_p.
......
...@@ -889,7 +889,9 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED) ...@@ -889,7 +889,9 @@ locate_ctor (tree type, void *client ATTRIBUTE_UNUSED)
tree fn = OVL_CURRENT (fns); tree fn = OVL_CURRENT (fns);
tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn)); tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
if (sufficient_parms_p (TREE_CHAIN (parms))) parms = skip_artificial_parms_for (fn, parms);
if (sufficient_parms_p (parms))
return fn; return fn;
} }
return NULL_TREE; return NULL_TREE;
......
// PR c++/24580
// { dg-do run }
struct vbase {};
struct foo : virtual vbase
{
foo()
{
throw "exception in foo ctor";
}
};
struct bar : public foo {};
int main()
{
try
{
bar a;
}
catch ( ... ) { }
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment