This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
A few comments: 1. I'm not sure about what should happen if the begin/end found in class scope are not ordinary functions.
My guess is that if it is a function (static or non-static) it is called normally, and if it is a member variable it is searched for an operator()(). If it is a type it should fail.
+ error ("range-based-for expression must be of a complete type");
static void cp_parser_perform_range_for_lookup (tree range, tree *begin, tree *end)
+ *end = finish_class_member_access_expr(range, *end, + false, tf_none); + + VEC(tree,gc) *vec; + vec = make_tree_vector ();
+ id_begin = get_identifier ("begin"); + *begin = build_qualified_name (/*type=*/NULL_TREE, + TREE_TYPE (range), + id_begin, + /*template_p=*/false); + *begin = finish_class_member_access_expr(range, *begin, + false, tf_none); + + id_end = get_identifier ("end"); + *end = build_qualified_name (/*type=*/NULL_TREE, + TREE_TYPE (range), + id_end, + /*template_p=*/false); + *end = finish_class_member_access_expr(range, *end, + false, tf_none);
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |