summaryrefslogtreecommitdiffstats
path: root/Tests/CMakeLib
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2023-12-02 11:37:40 (GMT)
committerBrad King <brad.king@kitware.com>2023-12-02 11:37:40 (GMT)
commit47fbb29ad79f403a8e11463169e2e4f7eadc8622 (patch)
tree9e046b3a4d63aa46bc40d34a8496e219fbc35613 /Tests/CMakeLib
parent0e11e24ecd2ae42ddac72d96090cada9fd7861e6 (diff)
downloadCMake-47fbb29ad79f403a8e11463169e2e4f7eadc8622.zip
CMake-47fbb29ad79f403a8e11463169e2e4f7eadc8622.tar.gz
CMake-47fbb29ad79f403a8e11463169e2e4f7eadc8622.tar.bz2
cmUVHandlePtr: Fix conversion to bool on Oracle Studio compiler
The operator added by commit 17690558c3 (cmUVHandlePtr: Add explicit conversion to bool, 2023-10-26) works in direct expressions like `if(foo)` but not compound expressions like `if(foo && ...)`. Drop the `explicit` mark when compiling with Oracle Studio so we can at least compile valid code.
Diffstat (limited to 'Tests/CMakeLib')
-rw-r--r--Tests/CMakeLib/testUVHandlePtr.cxx16
1 files changed, 16 insertions, 0 deletions
diff --git a/Tests/CMakeLib/testUVHandlePtr.cxx b/Tests/CMakeLib/testUVHandlePtr.cxx
index c97d755..17f672d 100644
--- a/Tests/CMakeLib/testUVHandlePtr.cxx
+++ b/Tests/CMakeLib/testUVHandlePtr.cxx
@@ -7,6 +7,21 @@
#include "cmGetPipes.h"
#include "cmUVHandlePtr.h"
+static bool testBool()
+{
+ cm::uv_async_ptr async;
+ cm::uv_handle_ptr handle;
+ cm::uv_idle_ptr idle;
+ cm::uv_pipe_ptr pipe;
+ cm::uv_process_ptr process;
+ cm::uv_signal_ptr signal;
+ cm::uv_stream_ptr stream;
+ cm::uv_timer_ptr timer;
+ cm::uv_tty_ptr tty;
+ return !async && !handle && !idle && !pipe && !process && !signal &&
+ !stream && !timer && !tty;
+}
+
static bool testIdle()
{
bool idled = false;
@@ -130,6 +145,7 @@ static bool testWriteCallback()
int testUVHandlePtr(int, char** const)
{
bool passed = true;
+ passed = testBool() && passed;
passed = testIdle() && passed;
passed = testTimer() && passed;
passed = testWriteCallback() && passed;