Give a better error for unsupported floating point arithmetic, instead of internal "Precondition violated" error.
This commit is contained in:
@@ -670,6 +670,10 @@ const Type* ArithmeticConvert (const Type* lhst, const Type* rhst)
|
|||||||
** floating point types are not (yet) supported.
|
** floating point types are not (yet) supported.
|
||||||
** The integral promotions are performed on both operands.
|
** The integral promotions are performed on both operands.
|
||||||
*/
|
*/
|
||||||
|
if (IsClassFloat(lhst) || IsClassFloat(rhst)) {
|
||||||
|
Error ("Floating point arithmetic not supported.");
|
||||||
|
return type_long;
|
||||||
|
}
|
||||||
lhst = IntPromotion (lhst);
|
lhst = IntPromotion (lhst);
|
||||||
rhst = IntPromotion (rhst);
|
rhst = IntPromotion (rhst);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user