http://gcc.gnu.org/bugzilla/show_bug.cgi?id=59621

Manuel López-Ibáñez <manu at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2013-12-29
                 CC|                            |manu at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #1 from Manuel López-Ibáñez <manu at gcc dot gnu.org> ---
The difficulty is that g++ parses all the initializers first and then does the
conversions and by that time the individual locations are gone. At the point of
the error, there is nothing that tells us the location of 'ap' or the location
'i'. Passing down those locations does not seem obvious to me due to the way
the C++ parser works.

If someone wishes to experiment, this is the backtrace:

#0  permerror (location=526, gmsgid=0x1716960 "invalid conversion from %qT to
%qT") at /home/manuel/test1/src/gcc/diagnostic.c:1024
#1  0x00000000005db814 in convert_like_real (convs=0x2087e10, expr=<parm_decl
0x7ffff7055000 i>, fn=<tree 0x0>, argnum=0, inner=0,
issue_conversion_warnings=true, c_cast_p=false, co\
mplain=3) at /home/manuel/test1/src/gcc/cp/call.c:5910
#2  0x00000000005e8efc in perform_implicit_conversion_flags (type=<pointer_type
0x7ffff6ef1150>, expr=<parm_decl 0x7ffff7055000 i>, complain=3, flags=1) at
/home/manuel/test1/src/gc\
c/cp/call.c:9022
#3  0x0000000000774e9c in convert_for_assignment (type=<pointer_type
0x7ffff6ef1150>, rhs=<parm_decl 0x7ffff7055000 i>, errtype=ICR_INIT,
fndecl=<tree 0x0>, parmnum=0, complain=3, f\
lags=1) at /home/manuel/test1/src/gcc/cp/typeck.c:8112
#4  0x0000000000775400 in convert_for_initialization (exp=<component_ref
0x7ffff6ee0840>, type=<pointer_type 0x7ffff6ef1150>, rhs=<parm_decl
0x7ffff7055000 i>, flags=1, errtype=ICR_\
INIT, fndecl=<tree 0x0>, parmnum=0, complain=3) at
/home/manuel/test1/src/gcc/cp/typeck.c:8203
#5  0x000000000077329e in cp_build_modify_expr (lhs=<component_ref
0x7ffff6ee0840>, modifycode=INIT_EXPR, rhs=<parm_decl 0x7ffff7055000 i>,
complain=3) at /home/manuel/test1/src/gcc\
/cp/typeck.c:7480
#6  0x0000000000789116 in perform_member_init (member=<field_decl
0x7ffff704b1c8 ap>, init=<parm_decl 0x7ffff7055000 i>) at
/home/manuel/test1/src/gcc/cp/init.c:732
#7  0x000000000078aa18 in emit_mem_initializers (mem_inits=<tree_list
0x7ffff703d708>) at /home/manuel/test1/src/gcc/cp/init.c:1097
#8  0x00000000007b2b40 in finish_mem_initializers (mem_inits=<tree_list
0x7ffff703d690>) at /home/manuel/test1/src/gcc/cp/semantics.c:1528
#9  0x0000000000721e21 in cp_parser_mem_initializer_list
(parser=0x7ffff7054000) at /home/manuel/test1/src/gcc/cp/parser.c:12237
#10 0x0000000000721963 in cp_parser_ctor_initializer_opt
(parser=0x7ffff7054000) at /home/manuel/test1/src/gcc/cp/parser.c:12148
#11 0x000000000072ca70 in cp_parser_ctor_initializer_opt_and_function_body
(parser=0x7ffff7054000, in_function_try_block=false) at
/home/manuel/test1/src/gcc/cp/parser.c:18561
#12 0x0000000000734301 in cp_parser_function_definition_after_declarator
(parser=0x7ffff7054000, inline_p=true) at
/home/manuel/test1/src/gcc/cp/parser.c:22608
#13 0x00000000007365f9 in cp_parser_late_parsing_for_member
(parser=0x7ffff7054000, member_function=<function_decl 0x7ffff7044e00 C>) at
/home/manuel/test1/src/gcc/cp/parser.c:23280
#14 0x000000000072e70f in cp_parser_class_specifier_1 (parser=0x7ffff7054000)
at /home/manuel/test1/src/gcc/cp/parser.c:19312
#15 0x000000000072e7ea in cp_parser_class_specifier (parser=0x7ffff7054000) at
/home/manuel/test1/src/gcc/cp/parser.c:19336
#16 0x0000000000724d4b in cp_parser_type_specifier (parser=0x7ffff7054000,
flags=1, decl_specs=0x7fffffffe210, is_declaration=true,
declares_class_or_enum=0x7fffffffe190, is_cv_qual\
ifier=0x7fffffffe18f) at /home/manuel/test1/src/gcc/cp/parser.c:14230
#17 0x0000000000720ab1 in cp_parser_decl_specifier_seq (parser=0x7ffff7054000,
flags=1, decl_specs=0x7fffffffe210, declares_class_or_enum=0x7fffffffe2a0) at
/home/manuel/test1/src/g\
cc/cp/parser.c:11475
#18 0x00000000007201d9 in cp_parser_simple_declaration (parser=0x7ffff7054000,
function_definition_allowed_p=true, maybe_range_for_decl=0x0) at
/home/manuel/test1/src/gcc/cp/parser.\
c:11065
#19 0x0000000000720174 in cp_parser_block_declaration (parser=0x7ffff7054000,
statement_p=false) at /home/manuel/test1/src/gcc/cp/parser.c:11014
#20 0x000000000071feef in cp_parser_declaration (parser=0x7ffff7054000) at
/home/manuel/test1/src/gcc/cp/parser.c:10911
#21 0x000000000071fa69 in cp_parser_declaration_seq_opt (parser=0x7ffff7054000)
at /home/manuel/test1/src/gcc/cp/parser.c:10797
#22 0x0000000000713e85 in cp_parser_translation_unit (parser=0x7ffff7054000) at
/home/manuel/test1/src/gcc/cp/parser.c:4018
#23 0x00000000007484d4 in c_parse_file () at
/home/manuel/test1/src/gcc/cp/parser.c:31259
#24 0x00000000008abfdd in c_common_parse_file () at
/home/manuel/test1/src/gcc/c-family/c-opts.c:1055
#25 0x0000000000d9abdb in compile_file () at
/home/manuel/test1/src/gcc/toplev.c:547
#26 0x0000000000d9cc7b in do_compile () at
/home/manuel/test1/src/gcc/toplev.c:1893
#27 0x0000000000d9cdea in toplev_main (argc=2, argv=0x7fffffffe5c8) at
/home/manuel/test1/src/gcc/toplev.c:1969
#28 0x0000000001535ebc in main (argc=2, argv=0x7fffffffe5c8) at
/home/manuel/test1/src/gcc/main.c:36

Reply via email to