diff options
author | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-14 22:48:01 +0000 |
---|---|---|
committer | Erik Pilkington <erik.pilkington@gmail.com> | 2019-02-14 22:48:01 +0000 |
commit | d5b017d601b483553f314db36c23aa1c11e0bb78 (patch) | |
tree | 0a98cddef95d7b1ea75ee593d2bf82ec03d035be /clang/test/SemaCXX/warn-float-conversion.cpp | |
parent | 3c76c09ebfa9fd8f55a6faed7792447b81d3b41b (diff) | |
download | bcm5719-llvm-d5b017d601b483553f314db36c23aa1c11e0bb78.tar.gz bcm5719-llvm-d5b017d601b483553f314db36c23aa1c11e0bb78.zip |
[Sema] Fix-up a -Wfloat-conversion diagnostic
We were warning on valid ObjC property reference exprs, and passing
in the wrong arguments to DiagnoseFloatingImpCast (leading to a badly
worded diagnostic).
rdar://47644670
Differential revision: https://reviews.llvm.org/D58145
llvm-svn: 354074
Diffstat (limited to 'clang/test/SemaCXX/warn-float-conversion.cpp')
-rw-r--r-- | clang/test/SemaCXX/warn-float-conversion.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/clang/test/SemaCXX/warn-float-conversion.cpp b/clang/test/SemaCXX/warn-float-conversion.cpp index 7dec4844b06..fad1ff147e4 100644 --- a/clang/test/SemaCXX/warn-float-conversion.cpp +++ b/clang/test/SemaCXX/warn-float-conversion.cpp @@ -44,17 +44,17 @@ void Convert(float f, double d, long double ld) { void CompoundAssignment() { int x = 3; - x += 1.234; //expected-warning{{conversion}} - x -= -0.0; //expected-warning{{conversion}} - x *= 1.1f; //expected-warning{{conversion}} - x /= -2.2f; //expected-warning{{conversion}} + x += 1.234; // expected-warning {{implicit conversion turns floating-point number into integer: 'double' to 'int'}} + x -= -0.0; // expected-warning {{implicit conversion turns floating-point number into integer: 'double' to 'int'}} + x *= 1.1f; // expected-warning {{implicit conversion turns floating-point number into integer: 'float' to 'int'}} + x /= -2.2f; // expected-warning {{implicit conversion turns floating-point number into integer: 'float' to 'int'}} - int y = x += 1.4f; //expected-warning{{conversion}} + int y = x += 1.4f; // expected-warning {{implicit conversion turns floating-point number into integer: 'float' to 'int'}} float z = 1.1f; double w = -2.2; - y += z + w; //expected-warning{{conversion}} + y += z + w; // expected-warning {{implicit conversion turns floating-point number into integer: 'double' to 'int'}} } # 1 "foo.h" 3 |