philnik777 wrote:

Sorry for coming in so late, but can't this already be implemented without any 
new machinery?
```c++
template <class T>
constexpr int addresspace = [] { static_assert(__is_pointer(T)); return 0; }();

template <class T, int N>
constexpr int addresspace<T [[clang::address_space(N)]]> = N;

#define addrspaceof(...) addresspace<decltype(__VA_ARGS__)>
```

Or is the main motivation here to have it for C?


https://github.com/llvm/llvm-project/pull/210242
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to