Fix locations in conversion_null_warnings (PR c++/71302)
PR c++/71302 reports that g++ shows poor locations for
-Wzero-as-null-pointer-constant for pointers in function calls,
using the close parenthesis of the call, rather than showing the
pertinent argument.
This particular case was fixed in GCC 8, but regressed on trunk
in r260973.
This patch fixes the regression, and adds column numbers to the
test cases (where they're correct) to avoid regressing them in the
future. There are still various places where the locations aren't
correct, but fixing them isn't stage 4 material.
gcc/cp/ChangeLog:
PR c++/71302
* call.c (get_location_for_expr_unwinding_for_system_header): New
function.
(conversion_null_warnings): Use it when getting locations for
EXPR, effectively adding a call to
get_location_for_expr_unwinding_for_system_header for
-Wconversion-null and making use of EXPR_LOCATION for
-Wzero-as-null-pointer-constant.
gcc/testsuite/ChangeLog:
PR c++/71302
* g++.dg/cpp0x/Wzero-as-null-pointer-constant-1.C: Add expected
column numbers to dg-warning directives where they are correct.
* g++.dg/warn/Wzero-as-null-pointer-constant-5.C: Likewise.
* g++.dg/warn/Wzero-as-null-pointer-constant-7.C: Likewise.
* g++.dg/warn/Wzero-as-null-pointer-constant-8.C: New test.
From-SVN: r268589