diff options
author | Brad King <brad.king@kitware.com> | 2023-12-03 13:29:01 (GMT) |
---|---|---|
committer | Kitware Robot <kwrobot@kitware.com> | 2023-12-03 13:29:20 (GMT) |
commit | 714a9467818beef9a29688766e196a1f064de033 (patch) | |
tree | 0bc72a820305401b88a109fb907714ceaf4e8b96 /Source | |
parent | 02c63208d830490bde84f214c48f667cdae0f599 (diff) | |
parent | 47fbb29ad79f403a8e11463169e2e4f7eadc8622 (diff) | |
download | CMake-714a9467818beef9a29688766e196a1f064de033.zip CMake-714a9467818beef9a29688766e196a1f064de033.tar.gz CMake-714a9467818beef9a29688766e196a1f064de033.tar.bz2 |
Merge topic 'uv-handle-bool'
47fbb29ad7 cmUVHandlePtr: Fix conversion to bool on Oracle Studio compiler
Acked-by: Kitware Robot <kwrobot@kitware.com>
Acked-by: buildbot <buildbot@kitware.com>
Merge-request: !9024
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmUVHandlePtr.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/cmUVHandlePtr.h b/Source/cmUVHandlePtr.h index 1b5eb9c..b8b3491 100644 --- a/Source/cmUVHandlePtr.h +++ b/Source/cmUVHandlePtr.h @@ -132,7 +132,15 @@ public: uv_handle_ptr_base_(std::nullptr_t) {} ~uv_handle_ptr_base_() { this->reset(); } +#if defined(__SUNPRO_CC) + // The Oracle Studio compiler recognizes 'explicit operator bool()' in + // 'if(foo)' but not 'if(foo && ...)'. The purpose of 'explicit' here + // is to avoid accidental conversion in non-boolean contexts. Just + // leave it out on this compiler so we can compile valid code. + operator bool() const; +#else explicit operator bool() const; +#endif /** * Properly close the handle if needed and sets the inner handle to nullptr |