On Fri, Apr 08, 2011 at 01:50:24PM -0400, Jason Merrill wrote: > On 03/24/2011 09:15 AM, Nathan Froyd wrote: >> + tree t = make_node (CASE_LABEL_EXPR); >> + >> + TREE_TYPE (t) = void_type_node; >> + SET_EXPR_LOCATION (t, input_location); > > As jsm and richi said, using input_location like this is a regression. > Can we use DECL_SOURCE_LOCATION (label_decl) instead?
Sure. Joseph, Richi, are you happy with that change? It would fix the C/C++ regression, as c_add_case_label does: /* Create the LABEL_DECL itself. */ label = create_artificial_label (loc); ... /* Add a CASE_LABEL to the statement-tree. */ case_label = add_stmt (build_case_label (loc, low_value, high_value, label)); so the DECL_SOURCE_LOCATION would be the same as the location_t we were passing in anyway. For the other languages, I think it would be neutral or an improvement (they all use input_location or UNKNOWN_LOCATION for the CASE_LABEL anyway). >> [PATCH 11/18] mark EXPR_PACK_EXPANSION as typed only >> http://gcc.gnu.org/ml/gcc-patches/2011-03/msg00563.html > > It looks like you need to add EXPR_PACK_EXPANSION cases to > value_dependent_expression_p and cp_tree_equal. Maybe split out the > code from write_expression that overrides TREE_OPERAND_LENGTH in some > cases and use that new function instead of TREE_OPERAND_LENGTH in these > places. Thanks for catching this, will do. -Nathan