Target mapping C++ members inside member functions
This is a merge of:
https://gcc.gnu.org/pipermail/gcc-patches/2020-December/562467.html
This patch fixes some problems with target mapping when inside
C++ member functions:
1. Allow deref '->' in map clauses.
2. Allow this[X] in map clauses.
3. Create map(this->member) from map(member), when encountering
member's FIELD_DECL.
This may possibly reverted/updated when a final patch is approved
for mainline.
gcc/cp/ChangeLog:
* parser.c (cp_parser_omp_clause_map): Adjust call to
cp_parser_omp_var_list_no_open to set 'allow_deref' argument to true.
* semantics.c (handle_omp_array_sections_1): Add handling to create
'this->member' from 'member' FIELD_DECL.
(finish_omp_clauses): Likewise. Adjust to allow 'this[]' in OpenMP
map clauses.
gcc/testsuite/ChangeLog:
* g++.dg/gomp/target-3.C: New test.
* g++.dg/gomp/this-2.C: Adjust testcase.