commit b27a03c5dcd721810269a876fd7f91e0d5a068ba
Author: Jason Merrill <jason@redhat.com>
Date: Tue Nov 8 13:09:24 2011 -0500
PR c++/51029
* class.c (build_base_path): Don't ICE in fold_non_dependent_expr.
@@ -359,6 +359,11 @@ build_base_path (enum tree_code code,
V_BINFO. That offset is an entry in D_BINFO's vtable. */
tree v_offset;
+ /* In a constructor template, current_in_charge_parm isn't set,
+ and we might end up here via fold_non_dependent_expr. */
+ if (fixed_type_p < 0 && !(cfun && current_in_charge_parm))
+ fixed_type_p = 0;
+
if (fixed_type_p < 0 && in_base_initializer)
{
/* In a base member initializer, we cannot rely on the
new file mode 100644
@@ -0,0 +1,14 @@
+// PR c++/51029
+
+struct A
+{
+ void foo();
+};
+
+struct B : virtual A
+{
+ template<int> B()
+ {
+ foo();
+ }
+};