Skip to content

Commit

Permalink
Merge pull request #4461 from yebblies/notoverride
Browse files Browse the repository at this point in the history
[DDMD] Fix conflicting checkIntegral/checkArithmetic
  • Loading branch information
yebblies committed Mar 9, 2015
2 parents a76499a + 9ac774b commit 823a4c0
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 16 deletions.
28 changes: 14 additions & 14 deletions src/expression.c
Expand Up @@ -6725,14 +6725,14 @@ Expression *BinExp::incompatibleTypes()
return this;
}

bool BinExp::checkIntegral()
bool BinExp::checkIntegralBin()
{
bool r1 = e1->checkIntegral();
bool r2 = e2->checkIntegral();
return (r1 || r2);
}

bool BinExp::checkArithmetic()
bool BinExp::checkArithmeticBin()
{
bool r1 = e1->checkArithmetic();
bool r2 = e2->checkArithmetic();
Expand Down Expand Up @@ -6799,9 +6799,9 @@ Expression *BinAssignExp::semantic(Scope *sc)
if (Expression *ex = typeCombine(this, sc))
return ex;

if (arith && checkArithmetic())
if (arith && checkArithmeticBin())
return new ErrorExp();
if ((bitwise || shift) && checkIntegral())
if ((bitwise || shift) && checkIntegralBin())
return new ErrorExp();
if (shift)
{
Expand Down Expand Up @@ -12523,7 +12523,7 @@ Expression *MulExp::semantic(Scope *sc)
return this;
}

if (checkArithmetic())
if (checkArithmeticBin())
return new ErrorExp();

if (type->isfloating())
Expand Down Expand Up @@ -12607,7 +12607,7 @@ Expression *DivExp::semantic(Scope *sc)
return this;
}

if (checkArithmetic())
if (checkArithmeticBin())
return new ErrorExp();

if (type->isfloating())
Expand Down Expand Up @@ -12694,7 +12694,7 @@ Expression *ModExp::semantic(Scope *sc)
return incompatibleTypes();
}

if (checkArithmetic())
if (checkArithmeticBin())
return new ErrorExp();

if (type->isfloating())
Expand Down Expand Up @@ -12761,7 +12761,7 @@ Expression *PowExp::semantic(Scope *sc)
return this;
}

if (checkArithmetic())
if (checkArithmeticBin())
return new ErrorExp();

// For built-in numeric types, there are several cases.
Expand Down Expand Up @@ -12849,7 +12849,7 @@ Expression *ShlExp::semantic(Scope *sc)
if (e)
return e;

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp;
if (e1->type->toBasetype()->ty == Tvector ||
e2->type->toBasetype()->ty == Tvector)
Expand Down Expand Up @@ -12881,7 +12881,7 @@ Expression *ShrExp::semantic(Scope *sc)
if (e)
return e;

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp();
if (e1->type->toBasetype()->ty == Tvector ||
e2->type->toBasetype()->ty == Tvector)
Expand Down Expand Up @@ -12913,7 +12913,7 @@ Expression *UshrExp::semantic(Scope *sc)
if (e)
return e;

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp();
if (e1->type->toBasetype()->ty == Tvector ||
e2->type->toBasetype()->ty == Tvector)
Expand Down Expand Up @@ -12967,7 +12967,7 @@ Expression *AndExp::semantic(Scope *sc)
return this;
}

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp();

return this;
Expand Down Expand Up @@ -13012,7 +13012,7 @@ Expression *OrExp::semantic(Scope *sc)
return this;
}

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp();

return this;
Expand Down Expand Up @@ -13057,7 +13057,7 @@ Expression *XorExp::semantic(Scope *sc)
return this;
}

if (checkIntegral())
if (checkIntegralBin())
return new ErrorExp();

return this;
Expand Down
4 changes: 2 additions & 2 deletions src/expression.h
Expand Up @@ -747,8 +747,8 @@ class BinExp : public Expression
Expression *binSemanticProp(Scope *sc);
Expression *checkComplexOpAssign(Scope *sc);
Expression *incompatibleTypes();
bool checkIntegral();
bool checkArithmetic();
bool checkIntegralBin();
bool checkArithmeticBin();

Expression *reorderSettingAAElem(Scope *sc);

Expand Down

0 comments on commit 823a4c0

Please sign in to comment.