Skip to content

Commit

Permalink
Investigate failing workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Vladiwostok committed Mar 3, 2024
1 parent 3c12dd7 commit 10c6de3
Showing 1 changed file with 28 additions and 28 deletions.
56 changes: 28 additions & 28 deletions src/dscanner/analysis/ifelsesame.d
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ extern (C++) class IfElseSameCheck(AST) : BaseAnalyzerDmd
}

mixin VisitBinaryExpression!(AST.LogicalExp);
mixin VisitBinaryExpression!(AST.EqualExp);
mixin VisitBinaryExpression!(AST.CmpExp);
//mixin VisitBinaryExpression!(AST.EqualExp);
//mixin VisitBinaryExpression!(AST.CmpExp);
mixin VisitBinaryExpression!(AST.AssignExp);

private template VisitBinaryExpression(NodeType)
Expand Down Expand Up @@ -153,32 +153,32 @@ unittest
}
}c, sac);

assertAnalyzerWarningsDMD(q{
void testCmpExprSame()
{
int a = 1, b = 2;

if (a == b) {}
if (a == a) {} // [warn]: Left side of '==' operator is identical to right side.

if (a != b) {}
if (a != a) {} // [warn]: Left side of '!=' operator is identical to right side.

b = a == a ? 1 : 2; // [warn]: Left side of '==' operator is identical to right side.

if (a > b) {}
if (a > a) {} // [warn]: Left side of '>' operator is identical to right side.

if (a < b) {}
if (a < a) {} // [warn]: Left side of '<' operator is identical to right side.

if (a >= b) {}
if (a >= a) {} // [warn]: Left side of '>=' operator is identical to right side.

if (a <= b) {}
if (a <= a) {} // [warn]: Left side of '<=' operator is identical to right side.
}
}c, sac);
//assertAnalyzerWarningsDMD(q{
// void testCmpExprSame()
// {
// int a = 1, b = 2;
//
// if (a == b) {}
// if (a == a) {} // [warn]: Left side of '==' operator is identical to right side.
//
// if (a != b) {}
// if (a != a) {} // [warn]: Left side of '!=' operator is identical to right side.
//
// b = a == a ? 1 : 2; // [warn]: Left side of '==' operator is identical to right side.
//
// if (a > b) {}
// if (a > a) {} // [warn]: Left side of '>' operator is identical to right side.
//
// if (a < b) {}
// if (a < a) {} // [warn]: Left side of '<' operator is identical to right side.
//
// if (a >= b) {}
// if (a >= a) {} // [warn]: Left side of '>=' operator is identical to right side.
//
// if (a <= b) {}
// if (a <= a) {} // [warn]: Left side of '<=' operator is identical to right side.
// }
//}c, sac);

assertAnalyzerWarningsDMD(q{
void testAssignSame()
Expand Down

0 comments on commit 10c6de3

Please sign in to comment.