[PATCH] D106785: [C++4OpenCL] Introduces __remove_address_space utility

Sven van Haastregt via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jul 27 02:12:57 PDT 2021


svenvh added a comment.

In D106785#2904619 <https://reviews.llvm.org/D106785#2904619>, @Anastasia wrote:

> I would like @svenvh to take a look from the clang header's design point.

Looks okay to me.



================
Comment at: clang/docs/LanguageExtensions.rst:1980
+    __private T var2; // error - conflicting address space qualifiers
+    __private __remove_address_space<T> var3; // compiled - var3 is __private int
+  }
----------------



================
Comment at: clang/test/CodeGenOpenCLCXX/remove-address-space.clcpp:14
+void test_remove_address_space() {
+  static_assert(is_same<__remove_address_space<__generic int>::type, int>::value,
+                "__generic address space not removed by __remove_address_space");
----------------
It's maybe worth testing `is_same` with `static_assert(!is_same<float, int>::value);` too, or at least testing some negative case.

A case without any address space qualifiers is currently missing (i.e., for the first trait).


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

https://reviews.llvm.org/D106785



More information about the cfe-commits mailing list