diff options
| author | John McCall <rjmccall@apple.com> | 2010-05-06 08:58:33 +0000 |
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-05-06 08:58:33 +0000 |
| commit | 323ed74658bc8375278eabf074b4777458376540 (patch) | |
| tree | 79c5ffce888a353671a67db832f8ba4c6520193d /include | |
| parent | 1b5a618c59025898806160ed5e7f0ff5bb79e482 (diff) | |
| download | clang-323ed74658bc8375278eabf074b4777458376540.tar.gz clang-323ed74658bc8375278eabf074b4777458376540.tar.bz2 clang-323ed74658bc8375278eabf074b4777458376540.tar.xz | |
Rearchitect -Wconversion and -Wsign-compare. Instead of computing them
"bottom-up" when implicit casts and comparisons are inserted, compute them
"top-down" when the full expression is finished. Makes it easier to
coordinate warnings and thus implement -Wconversion for signedness
conversions without double-warning with -Wsign-compare. Also makes it possible
to realize that a signedness conversion is okay because the context is
performing the inverse conversion. Also simplifies some logic that was
trying to calculate the ultimate comparison/result type and getting it wrong.
Also fixes a problem with the C++ explicit casts which are often "implemented"
in the AST with a series of implicit cast expressions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@103174 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
| -rw-r--r-- | include/clang/Basic/DiagnosticSemaKinds.td | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/include/clang/Basic/DiagnosticSemaKinds.td b/include/clang/Basic/DiagnosticSemaKinds.td index a62408129c..89f892cec1 100644 --- a/include/clang/Basic/DiagnosticSemaKinds.td +++ b/include/clang/Basic/DiagnosticSemaKinds.td @@ -883,6 +883,12 @@ def warn_impcast_float_precision : Warning< def warn_impcast_float_integer : Warning< "implicit cast turns floating-point number into integer: %0 to %1">, InGroup<DiagGroup<"conversion">>, DefaultIgnore; +def warn_impcast_integer_sign : Warning< + "implicit cast changes signedness: %0 to %1">, + InGroup<DiagGroup<"conversion">>, DefaultIgnore; +def warn_impcast_integer_sign_conditional : Warning< + "operand of ? changes signedness: %0 to %1">, + InGroup<DiagGroup<"conversion">>, DefaultIgnore; def warn_impcast_integer_precision : Warning< "implicit cast loses integer precision: %0 to %1">, InGroup<DiagGroup<"conversion">>, DefaultIgnore; |
