[PATCH] D72811: [WIP][OPENMP5.0] allow lvalue for motion clause

Alexey Bataev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 24 13:13:53 PST 2020


ABataev added a comment.

In D72811#1839538 <https://reviews.llvm.org/D72811#1839538>, @cchen wrote:

> In D72811#1837392 <https://reviews.llvm.org/D72811#1837392>, @jdoerfert wrote:
>
> > Thanks for working on this! While you are at it, `*this` is probably one of the most important ones to test and support.
>
>
> Can anyone tell me how to get `ValueDecl` from `CXXThisExpr`? I cannot find any method return decl in https://clang.llvm.org/doxygen/classclang_1_1CXXThisExpr.html#details.
>  Thanks!


CXXThisExpr is an expression without associated declaration.



================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15235
+  bool VisitUnaryOperator(UnaryOperator *UO) {
+    DerefCnt++;
+    CurComponents.emplace_back(UO, nullptr);
----------------
cchen wrote:
> cchen wrote:
> > ABataev wrote:
> > > Need a check that this is a dereference op. Also, maybe allow using an addr_of operation?
> > is addr_of operation allowed in lvalue?
> > 
> > In this code:
> > ```
> > int arr[50];
> > 
> > #pragma omp target map(&arr)
> >   {}
> > ```
> > We now reject `&arr` since `RE->IgnoreParenImpCasts()->isLValue()` return false. (RE is the expr of `&arr`)
> BTW, `RE->isLValue()` also return false in this case.
I'm not saying that `&var` must be allowed, but something like `*(&var)`. Of course, just `&var` is an rvalue.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D72811/new/

https://reviews.llvm.org/D72811





More information about the cfe-commits mailing list