From 7581231d9d0515782c28a167b2db913ebbffbc62 Mon Sep 17 00:00:00 2001 From: amai Date: Wed, 4 Apr 2018 14:31:48 +0200 Subject: [PATCH] #6426 FP duplicateExpressionTernary - (expr) ? ~0u : ~0ul. Add regression test --- test/testother.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/testother.cpp b/test/testother.cpp index 3210e6194..9db87483c 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -3870,6 +3870,12 @@ private: " return ((x > y) ? (y + x) : (x + y));\n" "}"); ASSERT_EQUALS("", errout.str()); + + // #6426 + check("void foo(bool flag) {\n" + " bar( (flag) ? ~0u : ~0ul);\n" + "}"); + ASSERT_EQUALS("", errout.str()); } void duplicateValueTernary() {