[PATCH c/40885] Fix build_indirect_ref i18n problems.

H.J. Lu hjl.tools@gmail.com
Thu Dec 17 08:30:00 GMT 2009


On Mon, Dec 14, 2009 at 10:38 PM, Shujing Zhao <pearly.zhao@oracle.com> wrote:
> Hi,
> This patch uses enum to emit the diagnostics and pass distinct full
> sentences to error for easy translation. The enum ref_operator is defined at
> c-common.h. It includes all the values that will be used at gcc/ or cp/.
>
> Several related test cases are added explicit dg-error strings.
>
> Tested on i686-pc-linux-gnu and no regression.
> Ok for trunk?
>
> Thanks
> Pearly
>
> gcc/
> 2009-12-15  Shujing Zhao  <pearly.zhao@oracle.com>
>
>        PR c/40885
>        * c-common.h (ref_operator): New type.
>        (build_indirect_ref): Adjust prototype with new argument.
>        * c-typeck.c (build_indirect_ref): Accept ref_operator as argument
> and
>        emit the diagnostics for easy translation.
>        (build_array_ref): Update calls to build_indirect_ref.
>        * c-omp.c (c_finish_omp_atomic): Likewise.
>        * c-parser.c (c_parser_unary_expression,
>        c_parser_postfix_expression_after_primary): Likewise.
>
> cp/
> 2009-12-15  Shujing Zhao  <pearly.zhao@oracle.com>
>
>        * typeck.c (build_indirect_ref): Update the argument.
>        (build_x_indirect_ref): Likewise.
>        (cp_build_indirect_ref): Update the argument and emit the diagnostics
>        for easy translation.
>        (build_class_member_access_expr, build_array_ref,
>        get_member_function_from_ptrfunc): Update calls.
>        * cp-tree.h (build_x_indirect_ref, cp_build_indirect_ref): Update
>        prototypes.
>        * call.c (build_new_op, convert_like_real, build_x_va_arg,
>        build_over_call): Update calls.
>        * class.c (build_base_path, build_simple_base_path, build_vfn_ref):
>        Likewise.
>        * decl.c (start_preparsed_function): Likewise.
>        * except.c (expand_start_catch_block, build_throw): Likewise.
>        * init.c (emit_mem_initializers, expand_virtual_init,
>        expand_virtual_init, build_new_1, build_vec_init, build_delete,
>        build_vec_delete): Likewise.
>        * parser.c (cp_parser_unary_expression): Likewise.
>        * pt.c (tsubst_copy_and_build): Likewise.
>        * rtti.c (build_headof, get_tinfo_decl_dynamic, get_typeid):
> Likewise.
>        * semantics.c (finish_non_static_data_member, thisify_lambda_field):
>        Likewise.
>        * tree.c (build_dummy_object, stabilize_expr): Likewise.
>        * typeck2.c (build_x_arrow): Likewise.

It may have broken bootstrap:

cc1: warnings being treated as errors
../../src-trunk/gcc/cp/call.c: In function 'build_over_call':
../../src-trunk/gcc/cp/call.c:5829:4: error: enum conversion when
passing argument 2 of 'cp_build_indirect_ref' is invalid in C++
../../src-trunk/gcc/cp/cp-tree.h:5302:13: note: expected
'ref_operator' but argument is of type 'int'
../../src-trunk/gcc/cp/call.c: In function 'build_java_interface_fn_ref':
../../src-trunk/gcc/cp/call.c:5938:54: error: enum conversion when
passing argument 2 of 'cp_build_indirect_ref' is invalid in C++
../../src-trunk/gcc/cp/cp-tree.h:5302:13: note: expected
'ref_operator' but argument is of type 'int'



-- 
H.J.



More information about the Gcc-patches mailing list