lmi-commits
[Top][All Lists]
Advanced

[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:



reply via email to

[Prev in Thread] Current Thread [Next in Thread]