]> granicus.if.org Git - clang/commit
Enhance the diagnostic for literal float -> int conversions to suggest
authorChandler Carruth <chandlerc@gmail.com>
Sun, 10 Apr 2011 08:36:24 +0000 (08:36 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 10 Apr 2011 08:36:24 +0000 (08:36 +0000)
commitf65076ebf5e8bc5ae7b77fe3c3a65dc5db8d763f
treef9249bf8d189c3335a127097de19c2e2aa38ea8e
parent8cf9049185c72dc453ebb946d39420f3f78dec76
Enhance the diagnostic for literal float -> int conversions to suggest
rewriting the literal when the value is integral. It is not uncommon to
see code written as:

  const int kBigNumber = 42e5;

Without any real awareness that this is no longer an ICE. The note helps
automate and ease the process of fixing code that violates the warning.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@129243 91177308-0d34-0410-b5e6-96231b3b80d8
include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaChecking.cpp
test/Sema/knr-def-call.c
test/SemaCXX/warn-literal-conversion.cpp