[PATCH] D85157: [Sema] Add casting check for integer to fixed point conversions

Bjorn Pettersson via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 3 15:49:06 PDT 2020


bjope added inline comments.


================
Comment at: clang/test/Sema/warn-bad-function-cast.c:49
+#ifdef FIXED_POINT
+  (void)(_Fract) if1(); // no warning
+#endif
----------------
bjope wrote:
> bjope wrote:
> > This should be added before the line saying `/* All following casts issue warning */`.
> Is the `(void)` needed/relevant here?
As questioned earlier, shouldn't we expect a warning for this scenario?

There is however a problem that we get the warning for _Fract to _Fract conversion. And it would be nice with a more complete set of tests involving both FixedPoint->FixedPoint, FixedPoint->Integer and Integer->FixedPoint casts.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D85157/new/

https://reviews.llvm.org/D85157



More information about the cfe-commits mailing list