https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66053
--- Comment #1 from Joseph S. Myers <jsm28 at gcc dot gnu.org> --- Author: jsm28 Date: Wed Jun 10 11:37:20 2015 New Revision: 224325 URL: https://gcc.gnu.org/viewcvs?rev=224325&root=gcc&view=rev Log: [gomp4] Support C++ "this" in OpenACC directives. This patch, for gomp-4_0-branch, adds support for C++ "this" in OpenACC directives. (This patch does not do anything to handle OpenMP differently from OpenACC; that - bug 66053 - will need to be resolved for mainline, either deciding these cases should be accepted for OpenMP or making the parsing only accept them in OpenACC directives and not OpenMP ones.) Apart from parsing, it's necessary to prevent the "cannot take the address of 'this', which is an rvalue expression" error from appearing when "this" is used in such contexts. This patch duly adds a new argument to cxx_mark_addressable (default false so callers don't all need to change) to allow disabling that error, passing that argument in all calls that seem relevant to OpenACC directives. Tested for x86_64-none-linux-gnu and applied to gomp-4_0-branch. gcc/cp: 2015-06-10 Joseph Myers <jos...@codesourcery.com> * parser.c (cp_parser_omp_var_list_no_open): Handle RID_THIS. * typeck.c (cxx_mark_addressable): Add argument ALLOW_THIS. * cp-tree.h (cxx_mark_addressable): Update prototype. * semantics.c (handle_omp_array_sections) (finish_omp_reduction_clause, finish_omp_clauses): Pass ALLOW_THIS to cxx_mark_addressable. libgomp: 2015-06-10 Cesar Philippidis <ce...@codesourcery.com> * testsuite/libgomp.oacc-c++/this.C: New test. Added: branches/gomp-4_0-branch/libgomp/testsuite/libgomp.oacc-c++/this.C Modified: branches/gomp-4_0-branch/gcc/cp/ChangeLog.gomp branches/gomp-4_0-branch/gcc/cp/cp-tree.h branches/gomp-4_0-branch/gcc/cp/parser.c branches/gomp-4_0-branch/gcc/cp/semantics.c branches/gomp-4_0-branch/gcc/cp/typeck.c branches/gomp-4_0-branch/libgomp/ChangeLog