Correct the reported line number in C++ combined OpenACC directives
authorCesar Philippidis <cesar@codesourcery.com>
Sun, 9 Dec 2018 12:48:26 +0000 (04:48 -0800)
committerThomas Schwinge <tschwinge@gcc.gnu.org>
Sun, 9 Dec 2018 12:48:26 +0000 (13:48 +0100)
commit65b5f496995864ec8d789f232ea25329fbf0bf62
treeefbbb9d02069970db68965c00676eb20b16a7273
parent4b195d270ca3fb13ffa0881cf0b4e92b25f7a560
Correct the reported line number in C++ combined OpenACC directives

The C++ FE doesn't set the expr_location of the split acc loop in combined acc
parallel/kernels loop directives. This only happens for with combined
directives, otherwise cp_parser_omp_construct would be responsible for setting
the location. After fixing this bug, I was able to resolve a couple of long
standing diagnostics discrepancies between the C/C++ FEs in the test suite.

gcc/cp/
* parser.c (cp_parser_oacc_kernels_parallel): Adjust EXPR_LOCATION
on the combined acc loop.
gcc/testsuite/
* c-c++-common/goacc/combined-directives-3.c: New test.
* c-c++-common/goacc/loop-2-kernels.c (void K): Adjust test.
* c-c++-common/goacc/loop-2-parallel.c (void P): Adjust test.
* c-c++-common/goacc/loop-3.c (void p2): Adjust test.

Reviewed-by: Thomas Schwinge <thomas@codesourcery.com>
From-SVN: r266923
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/goacc/combined-directives-3.c [new file with mode: 0644]
gcc/testsuite/c-c++-common/goacc/loop-2-kernels.c
gcc/testsuite/c-c++-common/goacc/loop-2-parallel.c
gcc/testsuite/c-c++-common/goacc/loop-3.c