summaryrefslogtreecommitdiff
path: root/cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cpp')
-rw-r--r--cpp/include/Ice/Optional.h2
-rw-r--r--cpp/src/Ice/ArgVector.cpp2
-rw-r--r--cpp/src/Ice/InputStream.cpp2
-rw-r--r--cpp/test/Ice/optional/StringView.h4
4 files changed, 5 insertions, 5 deletions
diff --git a/cpp/include/Ice/Optional.h b/cpp/include/Ice/Optional.h
index 059c309c39b..4c5bd85c5e3 100644
--- a/cpp/include/Ice/Optional.h
+++ b/cpp/include/Ice/Optional.h
@@ -210,7 +210,7 @@ template <class T> inline constexpr typename std::remove_reference<T>::type&& co
#if defined NDEBUG
# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) (EXPR)
#else
-# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) ((CHECK) ? (EXPR) : ([]{assert(!#CHECK);}(), (EXPR)))
+# define TR2_OPTIONAL_ASSERTED_EXPRESSION(CHECK, EXPR) ((CHECK) ? (EXPR) : ([]{assert(false && #CHECK);}(), (EXPR)))
#endif
namespace detail_
diff --git a/cpp/src/Ice/ArgVector.cpp b/cpp/src/Ice/ArgVector.cpp
index 48ce959524f..2a057f9a312 100644
--- a/cpp/src/Ice/ArgVector.cpp
+++ b/cpp/src/Ice/ArgVector.cpp
@@ -47,7 +47,7 @@ void
IceInternal::ArgVector::setupArgcArgv()
{
argc = static_cast<int>(_args.size());
- if((argv = new char*[argc + 1]) == 0)
+ if((argv = new char*[static_cast<size_t>(argc + 1)]) == 0)
{
throw ::std::bad_alloc();
}
diff --git a/cpp/src/Ice/InputStream.cpp b/cpp/src/Ice/InputStream.cpp
index 9f85122928d..d0c4c91d9fc 100644
--- a/cpp/src/Ice/InputStream.cpp
+++ b/cpp/src/Ice/InputStream.cpp
@@ -481,7 +481,7 @@ struct ReadBoolHelper
{
static bool* read(pair<const bool*, const bool*>& v, Int sz, InputStream::Container::iterator& i)
{
- bool* array = new bool[sz];
+ bool* array = new bool[static_cast<size_t>(sz)];
for(int idx = 0; idx < sz; ++idx)
{
array[idx] = static_cast<bool>(*(i + idx));
diff --git a/cpp/test/Ice/optional/StringView.h b/cpp/test/Ice/optional/StringView.h
index 5e642f57153..cf44dcc7108 100644
--- a/cpp/test/Ice/optional/StringView.h
+++ b/cpp/test/Ice/optional/StringView.h
@@ -11,7 +11,7 @@
// COMPILERFIX: G++ false positive "maybe-uninitialized" warnings when using
// string_view with Ice::optional in C++17 mode.
//
-#if defined(__GNUC__) && ICE_CPLUSPLUS >= 201703L
+#if defined(__GNUC__) && !defined(__clang__) && ICE_CPLUSPLUS >= 201703L
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wmaybe-uninitialized"
#endif
@@ -190,7 +190,7 @@ struct StreamHelper<Util::string_view, StreamHelperCategoryBuiltin>
}
-#if defined(__GNUC__) && ICE_CPLUSPLUS >= 201703L
+#if defined(__GNUC__) && !defined(__clang__) && ICE_CPLUSPLUS >= 201703L
# pragma GCC diagnostic pop
#endif