PR c++/24580
* method.c (locate_ctor): Skip all artificial parms, not just
'this'.
From-SVN: r106901
+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>
* parser.c (eof_token): Add initializer for ambiguous_p.
tree fn = OVL_CURRENT (fns);
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 NULL_TREE;
--- /dev/null
+// 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;
+}