[PATCH] D52835: [Diagnostics] Check integer to floating point number implicit conversions

Eli Friedman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 10 16:06:10 PDT 2018


efriedma added a comment.

Probably should have a test for something like `float x = (__uint128_t)-1;`, to make sure we print something reasonable.



================
Comment at: lib/Sema/SemaChecking.cpp:10874
+      if (Target->isSpecificBuiltinType(BuiltinType::LongDouble))
+        FloatSem = &llvm::APFloat::x87DoubleExtended();
+
----------------
ASTContext::getFloatTypeSemantics.  (Your explicit computation here is both redundant and wrong.)


https://reviews.llvm.org/D52835





More information about the cfe-commits mailing list