lmi-commits
[Top][All Lists]
Advanced

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

[lmi-commits] [lmi] master 60ea0a35 4/4: Sidestep a libstdc++ defect


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 60ea0a35 4/4: Sidestep a libstdc++ defect
Date: Thu, 18 Aug 2022 06:45:39 -0400 (EDT)

branch: master
commit 60ea0a35557266335223aa87c0af6d980dd94bcd
Author: Gregory W. Chicares <gchicares@sbcglobal.net>
Commit: Gregory W. Chicares <gchicares@sbcglobal.net>

    Sidestep a libstdc++ defect
    
    This warning occurs only with gcc-12 so far, but it seems pointless to
    restrict the pragma to that specific version because it's unknown when
    it might be fixed.
---
 expression_template_0_test.cpp | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/expression_template_0_test.cpp b/expression_template_0_test.cpp
index 1503a105..ce7e1b0c 100644
--- a/expression_template_0_test.cpp
+++ b/expression_template_0_test.cpp
@@ -296,7 +296,16 @@ void mete_valarray_typical()
         std::valarray<double> va9 = 3.14 - va0;
         va8 += va0;
         va8 += va0 * va1;
+
+        // https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106664
+#if defined LMI_GCC
+#   pragma GCC diagnostic push
+#   pragma GCC diagnostic ignored "-Walloc-zero"
+#endif // defined LMI_GCC
         va9 = (1.0 - va8) * va9;
+#if defined LMI_GCC
+#   pragma GCC diagnostic pop
+#endif // defined LMI_GCC
 
 // This doesn't compile, and std::valarray's only comparable facility
 // is its apply() member function, which applies only unary functions.



reply via email to

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