typeck.c (cp_build_addr_expr_1): Use the cp_expr_loc_or_input_loc location in a few...
authorPaolo Carlini <paolo.carlini@oracle.com>
Tue, 3 Dec 2019 20:46:32 +0000 (20:46 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Tue, 3 Dec 2019 20:46:32 +0000 (20:46 +0000)
commit34dda8045231413589fd1ac4ecd6a9cc97b51278
tree4658eb950ddd1ad2c05ffba18f8bd2fcbf828524
parentac0573de6cc4099d40263008ace3593d0d0647aa
typeck.c (cp_build_addr_expr_1): Use the cp_expr_loc_or_input_loc location in a few additional diagnostics; tidy.

/cp
2019-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

* typeck.c (cp_build_addr_expr_1): Use the cp_expr_loc_or_input_loc
location in a few additional diagnostics; tidy.
(check_return_expr): Likewise.

* typeck.c (cp_build_addr_expr_1): Use tree_strip_any_location_wrapper
for the address of main pedwarn.

/testsuite
2019-12-03  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/inconsistent-deduction-1.C: New.
* g++.dg/diagnostic/returning-a-value-1.C: Likewise.
* g++.dg/cpp0x/decltype3.C: Check location(s) too.
* g++.dg/cpp0x/decltype4.C: Likewise.
* g++.dg/cpp0x/lambda/lambda-deduce-ext-neg.C: Likewise.
* g++.dg/cpp2a/consteval13.C: Likewise.
* g++.dg/expr/pmf-1.C: Likewise.
* g++.dg/other/ptrmem2.C: Likewise.
* g++.dg/template/ptrmem17.C: Likewise.
* g++.old-deja/g++.bugs/900213_03.C: Likewise.
* g++.old-deja/g++.other/pmf7.C: Likewise.
* g++.old-deja/g++.other/ptrmem7.C: Likewise.

* g++.dg/diagnostic/main2.C: New.

From-SVN: r278947
16 files changed:
gcc/cp/ChangeLog
gcc/cp/typeck.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/decltype3.C
gcc/testsuite/g++.dg/cpp0x/decltype4.C
gcc/testsuite/g++.dg/cpp0x/lambda/lambda-deduce-ext-neg.C
gcc/testsuite/g++.dg/cpp2a/consteval13.C
gcc/testsuite/g++.dg/diagnostic/inconsistent-deduction-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/main2.C [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/returning-a-value-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/expr/pmf-1.C
gcc/testsuite/g++.dg/other/ptrmem2.C
gcc/testsuite/g++.dg/template/ptrmem17.C
gcc/testsuite/g++.old-deja/g++.bugs/900213_03.C
gcc/testsuite/g++.old-deja/g++.other/pmf7.C
gcc/testsuite/g++.old-deja/g++.other/ptrmem7.C