When doing << or >> operators, don't convert the return type to the type of the shift amount.

Fixes issue #73.  Previously, if we had e.g. an int16 type that was being shifted
left by 1, then the constant integer 1 would come in as an int32, we'd convert
the int16 to an int32, and then we'd do the shift.  Now, for shifts, the type
of the expression is always the same as the type of the value being shifted.
This commit is contained in:
Matt Pharr
2011-07-25 23:36:05 +01:00
parent 16be1d313e
commit d0674b1706
2 changed files with 27 additions and 12 deletions

2
expr.h
View File

@@ -97,7 +97,7 @@ public:
that incorporates the given error message string. In either
failure case, NULL is returned. */
Expr *TypeConv(const Type *type, const char *errorMsgBase = NULL,
bool failureOk = false);
bool failureOk = false, bool issuePrecisionWarnings = true);
};