From 7e822c4a4617cee0fa1450dbc9b1541edb3f9cc7 Mon Sep 17 00:00:00 2001 From: Andrew Corrigan Date: Mon, 19 Oct 2020 11:13:33 -0400 Subject: [PATCH] avoids clang -Wparentheses warning: using the result of an assignment as a condition, resolves #219 --- cub/util_device.cuh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cub/util_device.cuh b/cub/util_device.cuh index 5196f408c6..f219d69dda 100644 --- a/cub/util_device.cuh +++ b/cub/util_device.cuh @@ -320,7 +320,8 @@ public: // We don't use `CubDebug` here because we let the user code // decide whether or not errors are hard errors. - if (payload.error = std::forward(f)(payload.attribute)) + payload.error = std::forward(f)(payload.attribute); + if (payload.error) // Clear the global CUDA error state which may have been // set by the last call. Otherwise, errors may "leak" to // unrelated kernel launches.