File tree Expand file tree Collapse file tree 1 file changed +10
-0
lines changed
Expand file tree Collapse file tree 1 file changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ class TestOther : public TestFixture {
146146 TEST_CASE (duplicateExpression9); // #9320
147147 TEST_CASE (duplicateExpression10); // #9485
148148 TEST_CASE (duplicateExpression11); // #8916 (function call)
149+ TEST_CASE (duplicateExpression12); // #10026
149150 TEST_CASE (duplicateExpressionLoop);
150151 TEST_CASE (duplicateValueTernary);
151152 TEST_CASE (duplicateExpressionTernary); // #6391
@@ -5240,6 +5241,15 @@ class TestOther : public TestFixture {
52405241 ASSERT_EQUALS (" " , errout.str ());
52415242 }
52425243
5244+ void duplicateExpression12 () { // #10026
5245+ check (" int f(const std::vector<int> &buffer, const uint8_t index)\n "
5246+ " {\n "
5247+ " int var = buffer[index - 1];\n "
5248+ " return buffer[index - 1] - var;\n " // <<
5249+ " }" );
5250+ ASSERT_EQUALS (" [test.cpp:3] -> [test.cpp:4]: (style) Same expression on both sides of '-'.\n " , errout.str ());
5251+ }
5252+
52435253 void duplicateExpressionLoop () {
52445254 check (" void f() {\n "
52455255 " int a = 1;\n "
You can’t perform that action at this time.
0 commit comments