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]

[C++ Patch] PR 71238 ("Undeclared function message imprecisely points to error column")


Hi,

this diagnostic bug report is about an incorrect column (normally the final closed parenthesis) for error messages emitted by unqualified_fn_lookup_error. The substance of the fix is obvious - pass an appropriate column information to the function - and it handles correctly all the instances I could find in the C++ testsuite, but there are a few implementation details that certainly could be different. Note that I also tried to be quite conservative, thus actively avoid UNKNOWN_LOCATION to ever get through. Eventually I'm proposing to change unqualified_fn_lookup_error to take a cp_expr instead of my initial idea of adding a location_t parameter: this way the call from cp_parser_postfix_expression - which accounts for about a third of the locations fixed in the testsuite - is automatically handled and only the call from perform_koenig_lookup needs a little adjustment, to wrap the location in a cp_expr together with the identifier. But admittedly I didn't follow in detail the discussion which led to the introduction of cp_expr, I'm not sure this kind of wrapping counts as an "appropriate" use. Tested x86_64-linux.

Thanks,
Paolo.

//////////////////////////

Attachment: CL_71238
Description: Text document

Attachment: patch_71238
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]