This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH, OpenACC] Support C++ "this" in OpenACC directives (PR66053)


On 08/30/2018 04:27 PM, Jason Merrill wrote:

On Thu, Aug 30, 2018 at 3:31 PM, Julian Brown <julian@codesourcery.com> wrote:

"Apart from parsing, it's necessary to prevent the "cannot take the
address of 'this', which is an rvalue expression" error from appearing

Breaking a rather fundamental language attribute does not seem wise.

Why does referring to this[0:1] require making 'this' addressable?
Surely what we're interested in is the value of 'this', not the
address.
Yes, transferring the this pointer is very unlikely to be what the user wants -- the object being referred to contains the data. It might be wise to look at the DR's and changes relating to lambdas and this capture. Those changes now make it much harder to simply capture the pointer unintentionally.

nathan
--
Nathan Sidwell


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]