C++: underline parameters in mismatching function calls
authorDavid Malcolm <dmalcolm@redhat.com>
Fri, 22 Sep 2017 14:49:52 +0000 (14:49 +0000)
committerDavid Malcolm <dmalcolm@gcc.gnu.org>
Fri, 22 Sep 2017 14:49:52 +0000 (14:49 +0000)
commit9003adc732305c69346b8ae5699a250c033c31c1
treecac019ce232d5ffc46759f8e504ae17c9a014285
parent8c2ea6b20a48d626d3dae78ac177affb7f67e182
C++: underline parameters in mismatching function calls

gcc/cp/ChangeLog:
* call.c (get_fndecl_argument_location): New function.
(convert_like_real): Use it  when complaining about argument type
mismatches.
* cp-tree.h (struct cp_parameter_declarator): Add "loc" field.
* parser.c (make_parameter_declarator): Add "loc" param and use
it to initialize the new field.
(cp_parser_translation_unit): Add UNKNOWN_LOCATION for "loc" of
the "no_parameters" parameter.
(cp_parser_parameter_declaration_list): Set the location of the
result of grokdeclarator to be the parameter's loc, assuming no
errors.
(cp_parser_parameter_declaration): Generate a location for the
parameter and pass to make_parameter_declarator.

gcc/testsuite/ChangeLog:
* g++.dg/diagnostic/param-type-mismatch.C: Update expected results
to reflect highlighting of parameters; add test coverage for
callback parameters.

From-SVN: r253096
gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cp-tree.h
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/param-type-mismatch.C