summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--compilerplugins/clang/test/consttobool.cxx2
1 files changed, 2 insertions, 0 deletions
diff --git a/compilerplugins/clang/test/consttobool.cxx b/compilerplugins/clang/test/consttobool.cxx
index 28184825556e..3d880cb4d5d1 100644
--- a/compilerplugins/clang/test/consttobool.cxx
+++ b/compilerplugins/clang/test/consttobool.cxx
@@ -55,6 +55,7 @@ int main()
// expected-error@+1 {{implicit conversion of constant 3 of type 'int' to 'bool'; use 'true' instead [loplugin:consttobool]}}
b = (c1 | c2);
+#if !defined NDEBUG
assert(b); // no warnings from within assert macro itself
assert(b && "msg"); // no warnings for `&& "msg"`
if (b)
@@ -63,6 +64,7 @@ int main()
}
// expected-error@+1 {{implicit conversion of constant &"msg"[0] of type 'const char *' to 'bool'; use 'true' instead [loplugin:consttobool]}}
assert("msg");
+#endif
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */