Hi!

The g++.dg/reflect/anon4.C test FAILs on i686-linux, because with
excess precision the store to .c rounds to double precision, but comparison
of it against 3.14 constant doesn't.

Tested on x86_64-linux and i686-linux, committed to trunk as obvious.

2026-03-02  Jakub Jelinek  <[email protected]>

        * g++.dg/reflect/anon4.C (test): Use (double) 3.14 instead of 3.14 in
        comparisons.

--- gcc/testsuite/g++.dg/reflect/anon4.C.jj     2026-03-02 07:43:12.513785271 
+0100
+++ gcc/testsuite/g++.dg/reflect/anon4.C        2026-03-02 07:56:49.168129712 
+0100
@@ -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);
 }

        Jakub

Reply via email to