diff --git a/lib/checkother.cpp b/lib/checkother.cpp index ccc5d8d17..33a869b5f 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -2582,10 +2582,10 @@ void CheckOther::complexDuplicateExpressionCheck(const std::list 3.\n", errout.str()); } + void sameExpression() { + // #3868 - false positive (same expression on both sides of |) + check("void f(int x) {\n" + " a = x ? A | B | C\n" + " : A | B;\n" + "}"); + ASSERT_EQUALS("", errout.str()); + } + void comparisonOfBoolExpressionWithInt1() { check("void f(int x) {\n" " if ((x && 0x0f)==6)\n"