[PATCH] D53764: [OpenCL] Enable address spaces for references in C++

Anastasia Stulova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Oct 26 07:57:15 PDT 2018


Anastasia added inline comments.


================
Comment at: lib/AST/Expr.cpp:1609
   case CK_AddressSpaceConversion:
-    assert(getType()->isPointerType() || getType()->isBlockPointerType());
-    assert(getSubExpr()->getType()->isPointerType() ||
-           getSubExpr()->getType()->isBlockPointerType());
-    assert(getType()->getPointeeType().getAddressSpace() !=
-           getSubExpr()->getType()->getPointeeType().getAddressSpace());
-    LLVM_FALLTHROUGH;
+    assert(/*If pointer type then addr spaces for pointees must differ*/
+           (((getType()->isPointerType() &&
----------------
I don't like this assert now. Would adding extra variable be cleaner here?


https://reviews.llvm.org/D53764





More information about the cfe-commits mailing list