[PATCH] D103894: NarrowingConversionsCheck should support inhibiting conversions of mixed integer and floating point types with WarnOnEquivalentBitWidth=0.
Stephen Concannon via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed Jun 9 18:28:09 PDT 2021
Stephen updated this revision to Diff 351029.
Stephen added a comment.
Try specifying the commit range.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D103894/new/
https://reviews.llvm.org/D103894
Files:
clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-equivalentbitwidth-option.cpp
Index: clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-equivalentbitwidth-option.cpp
===================================================================
--- clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-equivalentbitwidth-option.cpp
+++ clang-tools-extra/test/clang-tidy/checkers/cppcoreguidelines-narrowing-conversions-equivalentbitwidth-option.cpp
@@ -18,19 +18,21 @@
float f;
i = f;
- // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to signed type 'int' is implementation-defined [cppcoreguidelines-narrowing-conversions]
+ // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'float' to 'int' [cppcoreguidelines-narrowing-conversions]
// DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0.
+
f = i;
- // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to signed type 'float' is implementation-defined [cppcoreguidelines-narrowing-conversions]
+ // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'int' to 'float' [cppcoreguidelines-narrowing-conversions]
// DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0.
long long ll;
double d;
ll = d;
- // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to signed type 'long long' is implementation-defined [cppcoreguidelines-narrowing-conversions]
+ // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:8: warning: narrowing conversion from 'double' to 'long long' [cppcoreguidelines-narrowing-conversions]
// DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0.
+
d = ll;
- // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to signed type 'double' is implementation-defined [cppcoreguidelines-narrowing-conversions]
+ // CHECK-MESSAGES-DEFAULT: :[[@LINE-1]]:7: warning: narrowing conversion from 'long long' to 'double' [cppcoreguidelines-narrowing-conversions]
// DISABLED: Warning disabled with WarnOnEquivalentBitWidth=0.
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103894.351029.patch
Type: text/x-patch
Size: 2103 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210610/e90670ff/attachment.bin>
More information about the cfe-commits
mailing list