ABataev added inline comments.

================
Comment at: clang/lib/Sema/SemaOpenMP.cpp:15710
+    // know the other subtree is just an offset)
+    assert(BO->getType()->isPointerType() &&
+           "Expect the binary operator be pointer type");
----------------
cchen wrote:
> cchen wrote:
> > ABataev wrote:
> > > Not sure this should be an assert. What if you have something like 
> > > `*((a+b) + c)` and `a+b` is not pointer arithmetic?
> > Good point, I'll fix it. Thanks
> Well, for this case, the type of binop expr `*((a+b) + c)` is `int *`, and 
> the type of LHS is `int`, while the type of RHS is `int *`, therefore, expr 
> `(a+b)` is not going to be visited. I'm using assert here since before the 
> `checkMapClauseExpressionBase` be called, we have already check for whether 
> the expression is lvalue. Maybe I'll just error out if binop here is not a 
> pointer type instead of `assert`?
Yes


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D75077



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to