]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
testsuite: Fix up anon4.C test for excess precision targets
authorJakub Jelinek <jakub@redhat.com>
Mon, 2 Mar 2026 07:02:45 +0000 (08:02 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Mon, 2 Mar 2026 07:02:45 +0000 (08:02 +0100)
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  <jakub@redhat.com>

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

gcc/testsuite/g++.dg/reflect/anon4.C

index 45117a3c0481f79f150438d8ddaadaccb6d86728..333633e66ef42d7334c908773dd7fa65c4c045d0 100644 (file)
@@ -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);
 }