lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master a32113e: Fix an anomaly identified by gcc-8.3


From: Greg Chicares
Subject: [lmi-commits] [lmi] master a32113e: Fix an anomaly identified by gcc-8.3
Date: Wed, 19 Jun 2019 08:53:00 -0400 (EDT)

branch: master
commit a32113e1d88e9cca6663ce730d42d492689930e5
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Fix an anomaly identified by gcc-8.3
    
    Created an object as 'C {x,y,z}' instead of as 'C({x,y,z})' to avoid an
    apparent ambiguity that gcc-8.3 considers an error but gcc-7.2 doesn't.
    (Actually, '(C {x,y,z})' is written--the outer parentheses are needed
    because the expression is a macro argument--but that has nothing to do
    with the C++ issue at hand.)
    
    Paraphrased gcc diagnostics:
    
    In 'static void input_test::test_product_database()'
      /opt/lmi/src/lmi/input_test.cpp:229:86:
    with initializer list:
      ({mce_male, mce_rated, mce_smoker, 100, mce_medical, mce_s_XX})
    
    error: call of overloaded
      'database_index(<brace-enclosed initializer list>)' is ambiguous
    candidates:
      'database_index::database_index(std::array<int, 6>)'
      'constexpr database_index::database_index(const database_index&)'
      'constexpr database_index::database_index(database_index&&)'
    
    This report seems similar:
      https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84849
    and the maintainers seem to have accepted it as a defect, or at least
    not to have rejected it as not-a-defect.
---
 input_test.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/input_test.cpp b/input_test.cpp
index 2debd45..0b2a03e 100644
--- a/input_test.cpp
+++ b/input_test.cpp
@@ -226,12 +226,12 @@ void input_test::test_product_database()
 
     // Test presumptive issue-age bounds in class database_index.
     BOOST_TEST_THROW
-        (database_index({mce_male, mce_rated, mce_smoker, 100, mce_medical, 
mce_s_XX})
+        ((database_index {mce_male, mce_rated, mce_smoker, 100, mce_medical, 
mce_s_XX})
         ,std::runtime_error
         ,"Assertion '0 <= issue_age() && issue_age() < e_max_dim_issue_age' 
failed."
         );
     BOOST_TEST_THROW
-        (database_index({mce_male, mce_rated, mce_smoker, -1, mce_medical, 
mce_s_XX})
+        ((database_index {mce_male, mce_rated, mce_smoker, -1, mce_medical, 
mce_s_XX})
         ,std::runtime_error
         ,"Assertion '0 <= issue_age() && issue_age() < e_max_dim_issue_age' 
failed."
         );



reply via email to

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