static member in template class
Mark Mitchell
mark@markmitchell.com
Tue Nov 3 22:30:00 GMT 1998
>>>>> "Ulrich" == Ulrich Drepper <drepper@cygnus.com> writes:
Ulrich> This is with a quite recent egcs version. Compiling the
Ulrich> program below with
Ulrich> gcc -c y.cc
Ulrich> leads to the following message:
Ulrich> y.cc:11: conflicting types for `int foo<int>::bar[0]'
Ulrich> y.cc:8: previous declaration as `int foo<int>::bar[0]'
This bug was exposed my recent changes to array type-checking. It is
not the fault of those changes; just a consequence.
On the one hand, the attached patch fixes it. On the other hand, the
middle-end has a bizarre inconsistency. More on that in another mail.
--
Mark Mitchell mark@markmitchell.com
Mark Mitchell Consulting http://www.markmitchell.com
1998-11-03 Mark Mitchell <mark@markmitchell.com>
* pt.c (tsubst): Use build_index_type, not build_index_2_type.
Index: pt.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/pt.c,v
retrieving revision 1.228
diff -c -p -r1.228 pt.c
*** pt.c 1998/11/01 15:45:05 1.228
--- pt.c 1998/11/04 06:24:27
*************** tsubst (t, args, in_decl)
*** 5542,5548 ****
}
max = fold (build_binary_op (MINUS_EXPR, max, integer_one_node, 1));
! return build_index_2_type (size_zero_node, max);
}
case TEMPLATE_TYPE_PARM:
--- 5542,5548 ----
}
max = fold (build_binary_op (MINUS_EXPR, max, integer_one_node, 1));
! return build_index_type (max);
}
case TEMPLATE_TYPE_PARM:
More information about the Gcc-patches
mailing list