[clang] Fix for OpenMP offloading compilation error with GNU++20 option when using complex header (PR #115306)
Shilei Tian via cfe-commits
cfe-commits at lists.llvm.org
Fri Nov 8 08:26:33 PST 2024
================
@@ -64,8 +64,13 @@ template <class _Tp> __DEVICE__ _Tp norm(const std::complex<_Tp> &__c) {
}
// conj
-
-template <class _Tp> std::complex<_Tp> conj(const std::complex<_Tp> &__c) {
+#ifdef _GLIBCXX20_CONSTEXPR
+#define CXX20_CONSTEXPR_DEVICE __DEVICE__
----------------
shiltian wrote:
I wonder why this is not `constexpr` in C++20 but `__DEVICE__` instead?
https://github.com/llvm/llvm-project/pull/115306
More information about the cfe-commits
mailing list