summaryrefslogtreecommitdiffstats
path: root/tools/clang-tidy/test/bugprone-assert-side-effect.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tools/clang-tidy/test/bugprone-assert-side-effect.cpp')
-rw-r--r--tools/clang-tidy/test/bugprone-assert-side-effect.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tools/clang-tidy/test/bugprone-assert-side-effect.cpp b/tools/clang-tidy/test/bugprone-assert-side-effect.cpp
new file mode 100644
index 0000000000..7cc0a79cf1
--- /dev/null
+++ b/tools/clang-tidy/test/bugprone-assert-side-effect.cpp
@@ -0,0 +1,8 @@
+#include "structures.h"
+
+// bugprone-assert-side-effect
+void misc_assert_side_effect() {
+ int X = 0;
+ assert(X == 1);
+ assert(X = 1);
+}