ziangwan created this revision.
ziangwan added reviewers: kongyi, pirama, rsmith, nickdesaulniers.
Herald added subscribers: cfe-commits, jdoerfert, jfb, mgrang, javed.absar.
Herald added a project: clang.

These code:

  long i = 222222222222L;
  float a = 222222222222L:
  float b = a + i;

Will now issue warnings:

  line 2: implicit conversion from 'long' to 'float' changes value from 
222222222222 to 222222221312 [-Wimplicit-float-conversion]
  line 3: implicit conversion from 'long' to 'float' may loses integer 
precision. [-Wimplicit-float-conversion]

The same feature is present in GCC but not currently in clang.


Repository:
  rC Clang

https://reviews.llvm.org/D64666

Files:
  clang/include/clang/Basic/DiagnosticSemaKinds.td
  clang/lib/Driver/ToolChains/Arch/AArch64.cpp
  clang/lib/Sema/SemaChecking.cpp
  clang/test/Sema/conversion.c
  clang/test/Sema/ext_vector_casts.c
  clang/test/Sema/implicit-float-conversion.c
  patch.patch



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to