[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lmi-commits] [lmi] master 71238a3 4/8: Disable clang tautological const
From: |
Greg Chicares |
Subject: |
[lmi-commits] [lmi] master 71238a3 4/8: Disable clang tautological constant compare warning in a test |
Date: |
Mon, 8 Mar 2021 11:19:46 -0500 (EST) |
branch: master
commit 71238a32f412078451c6bb0d3578427a40c4235f
Author: Vadim Zeitlin <vadim@tt-solutions.com>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>
Disable clang tautological constant compare warning in a test
The compiler correctly detects that the comparison is always false and
helpfully warns about it, so we have no choice but to suppress this
warning locally.
---
input_test.cpp | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/input_test.cpp b/input_test.cpp
index 1a65ec4..3c7ccef 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -159,12 +159,21 @@ void input_test::test_product_database()
// Test query<enumerative type> with non-enumerative entities.
+#if defined __clang__
+# pragma clang diagnostic push
+# pragma clang diagnostic ignored
"-Wtautological-constant-out-of-range-compare"
+#endif // defined __clang__
+
// This value corresponds to no enumerator, but C++ allows that.
db.query_into(DB_ChildRiderMinAmt, a);
LMI_TEST_EQUAL(25000, a);
auto const b {db.query<oenum_alb_or_anb>(DB_ChildRiderMinAmt)};
LMI_TEST_EQUAL(25000, b);
+#if defined __clang__
+# pragma clang diagnostic pop
+#endif // defined __clang__
+
// Redundant template argument is okay.
db.query_into<oenum_alb_or_anb>(DB_ChildRiderMinAmt, a);
// Fails to compile with wrong template argument:
- [lmi-commits] [lmi] master updated (0ec5f1b -> 9cc560d), Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 88f799c 6/8: Avoid using gcc-specific warnings with clang, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master d126046 5/8: Disable clang -Wbraced-scalar-init in a test, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 9cc560d 8/8: Fix defect introduced 20210303T1108Z: misalignment, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 71238a3 4/8: Disable clang tautological constant compare warning in a test,
Greg Chicares <=
- [lmi-commits] [lmi] master 0dda3f5 2/8: Disable clang -Wself-assign-overloaded warning in date test, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master fc767f7 3/8: Include <cmath> to get std::rint() declaration, not <math.h>, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master 33a1270 1/8: Remove tests involving std::mem_fun, Greg Chicares, 2021/03/08
- [lmi-commits] [lmi] master f5d41a0 7/8: Replace raw string literals, Greg Chicares, 2021/03/08