keryell added a comment. While it might be possible to extend arbitrarily C++, I have the feeling that having just 1 destructor and have a different code path-code according the address space would not be enough. It is possible to write:
~MyDestructor() { if constexpr (SomeAPIReturningAddressSpace() == ...::Global) { /* Global address space code */ } else if constexpr (...) { } } It is possible to build higher-level dispatching constructs from this in OpenCL C++ library, for example à la `std::visit` from `std::variant`. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109609/new/ https://reviews.llvm.org/D109609 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits