Index: clang/lib/Sema/SemaExpr.cpp =================================================================== --- clang/lib/Sema/SemaExpr.cpp +++ clang/lib/Sema/SemaExpr.cpp @@ -1115,6 +1115,11 @@ bool LHSFloat = LHSType->isRealFloatingType(); bool RHSFloat = RHSType->isRealFloatingType(); + // FIXME: Implement Floating-fixedpoint conversion. (Bug 46268) + // Reference N1169 4.1.4 (Type conversion, usual arithmetic conversions). + if ((LHSType->isFixedPointType() && RHSType->isRealFloatingType()) || + (LHSType->isRealFloatingType() && RHSType->isFixedPointType())) + return QualType(); // If we have two real floating types, convert the smaller operand // to the bigger result. if (LHSFloat && RHSFloat) { Index: clang/test/Frontend/fixed_point_errors.c =================================================================== --- clang/test/Frontend/fixed_point_errors.c +++ clang/test/Frontend/fixed_point_errors.c @@ -250,3 +250,8 @@ char c_const = 256.0uk; // expected-warning{{implicit conversion from 256.0 cannot fit within the range of values for 'char'}} short _Accum sa_const5 = 256; // expected-warning{{implicit conversion from 256 cannot fit within the range of values for 'short _Accum'}} unsigned short _Accum usa_const2 = -2; // expected-warning{{implicit conversion from -2 cannot fit within the range of values for 'unsigned short _Accum'}} + +void foo(void) { + _Accum x = 0.5k; + if (x == 0.5) {} // expected-error{{invalid operands to binary expression ('_Accum' and 'double')}} +}