aaron.ballman added inline comments.
================ Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions-long-is-32bits.cpp:4-10 + int i; // i.e. int32_t + long l; // i.e. int32_t + long long ll; // i.e. int64_t + + unsigned int ui; // i.e. uint32_t + unsigned long ul; // i.e. uint32_t + unsigned long long ull; // i.e. uint64_t ---------------- Add some `static_assert`s for these bit sizes? ================ Comment at: test/clang-tidy/cppcoreguidelines-narrowing-conversions.cpp:42-44 i += 2.0; - // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from 'double' to 'int' [cppcoreguidelines-narrowing-conversions] + // CHECK-MESSAGES: :[[@LINE-1]]:5: warning: narrowing conversion from constant 'double' to 'int' [cppcoreguidelines-narrowing-conversions] i += 2.0f; ---------------- I don't think these should diagnose. They're both harmless as the literal values are exactly representable in the destination type. Repository: rCTE Clang Tools Extra https://reviews.llvm.org/D53488 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits