diff --git a/sycl/include/sycl/ext/oneapi/properties/properties.hpp b/sycl/include/sycl/ext/oneapi/properties/properties.hpp index 354975b857d13..4d3e11ec8b143 100644 --- a/sycl/include/sycl/ext/oneapi/properties/properties.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/properties.hpp @@ -48,7 +48,7 @@ using properties_t = properties>; template -inline constexpr bool properties_are_unique = []() constexpr { +inline constexpr bool properties_are_unique = []() constexpr -> bool { if constexpr (sizeof...(property_tys) == 0) { return true; } else { @@ -64,7 +64,7 @@ inline constexpr bool properties_are_unique = []() constexpr { }(); template -inline constexpr bool properties_are_sorted = []() constexpr { +inline constexpr bool properties_are_sorted = []() constexpr -> bool { if constexpr (sizeof...(property_tys) == 0) { return true; } else { diff --git a/sycl/include/sycl/ext/oneapi/properties/property.hpp b/sycl/include/sycl/ext/oneapi/properties/property.hpp index 37e1777e21235..d68ec8884d93b 100644 --- a/sycl/include/sycl/ext/oneapi/properties/property.hpp +++ b/sycl/include/sycl/ext/oneapi/properties/property.hpp @@ -258,7 +258,7 @@ struct property_base : property_key_tag { // Temporary, to ensure new code matches previous behavior and to catch any // silly copy-paste mistakes. MSVC can't compile it, but linux-only is // enough for this temporary check. - static_assert([]() constexpr { + static_assert([]() constexpr -> bool { if constexpr (std::is_same_v) // key_t is incomplete at this point for runtime properties. return true; diff --git a/sycl/test/regression/grf_properties_wa.cpp b/sycl/test/regression/grf_properties_wa.cpp new file mode 100644 index 0000000000000..5bce42a25734a --- /dev/null +++ b/sycl/test/regression/grf_properties_wa.cpp @@ -0,0 +1,15 @@ +// RUN: %clangxx -fsycl -fsyntax-only %s + +// Test for a workaround to a bug in clang causing some constexpr lambda +// expressions to not be identified as returning a bool. + +#include +#include +#include + +int main() { + if constexpr (false) { + sycl::ext::oneapi::experimental::properties prop{ + sycl::ext::intel::experimental::grf_size<256>}; + } +}