https://gcc.gnu.org/g:da8c308f3509296ea16bc56d3733102b7b4ac918

commit r16-7834-gda8c308f3509296ea16bc56d3733102b7b4ac918
Author: Jakub Jelinek <[email protected]>
Date:   Mon Mar 2 08:02:45 2026 +0100

    testsuite: Fix up anon4.C test for excess precision targets
    
    The g++.dg/reflect/anon4.C test FAILs on i686-linux, because with
    extended precision the store to .c rounds to double precision, but 
comparison
    of it against 3.14 constant doesn't.
    
    2026-03-02  Jakub Jelinek  <[email protected]>
    
            * g++.dg/reflect/anon4.C (test): Use (double) 3.14 instead of 3.14 
in
            comparisons.

Diff:
---
 gcc/testsuite/g++.dg/reflect/anon4.C | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gcc/testsuite/g++.dg/reflect/anon4.C 
b/gcc/testsuite/g++.dg/reflect/anon4.C
index 45117a3c0481..333633e66ef4 100644
--- a/gcc/testsuite/g++.dg/reflect/anon4.C
+++ b/gcc/testsuite/g++.dg/reflect/anon4.C
@@ -28,6 +28,6 @@ void test ()
 
   constexpr foo bar1 { .i = 42, .c = 3.14 };
 
-  static_assert (bar1.c == 3.14);
-  static_assert (bar1.[: ^^foo::c :] == 3.14);
+  static_assert (bar1.c == (double) 3.14);
+  static_assert (bar1.[: ^^foo::c :] == (double) 3.14);
 }

Reply via email to