From e1c07728e6ddccfb3821a5f709bd306e037284b9 Mon Sep 17 00:00:00 2001 From: Andrei Elovikov Date: Thu, 15 Aug 2024 10:51:56 -0700 Subject: [PATCH] [SYCL] Fix `bfloat16` to compile with clang < 0.0.0 ``` struct A { // Fails to compile with clang 8.0.1, ok 9.0.0 constexpr A& operator=(const A&) = default; ~A() = default; }; struct B { // Ok with either version ~B() = default; constexpr B& operator=(const B&) = default; }; int main() { A a; B b; return 0; } ``` Since the workaround isn't hurting readability/maintenance might just do it even if the support for such old clang is questionable. --- sycl/include/sycl/ext/oneapi/bfloat16.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sycl/include/sycl/ext/oneapi/bfloat16.hpp b/sycl/include/sycl/ext/oneapi/bfloat16.hpp index 2887bce3b9593..70b96a3976d39 100644 --- a/sycl/include/sycl/ext/oneapi/bfloat16.hpp +++ b/sycl/include/sycl/ext/oneapi/bfloat16.hpp @@ -92,10 +92,10 @@ class bfloat16 { public: bfloat16() = default; + ~bfloat16() = default; constexpr bfloat16(const bfloat16 &) = default; constexpr bfloat16(bfloat16 &&) = default; constexpr bfloat16 &operator=(const bfloat16 &rhs) = default; - ~bfloat16() = default; private: static detail::Bfloat16StorageT from_float_fallback(const float &a) {