]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
c++: fix typo in consteval, array, modules [PR124973]
authorJason Merrill <jason@redhat.com>
Thu, 23 Apr 2026 13:20:57 +0000 (09:20 -0400)
committerJason Merrill <jason@redhat.com>
Thu, 23 Apr 2026 14:16:23 +0000 (10:16 -0400)
Argh, I must have typoed when I realized that we wanted to check
ff_genericize here rather than !ff_only_non_odr.  And didn't notice the
problem because I also forgot the -O in the testcase.

PR c++/124973

gcc/cp/ChangeLog:

* cp-gimplify.cc (cp_fold_r): Fix typo.

gcc/testsuite/ChangeLog:

* g++.dg/modules/consteval-1_b.C: Add -O.

gcc/cp/cp-gimplify.cc
gcc/testsuite/g++.dg/modules/consteval-1_b.C

index 8ae664058171fea5b3a8cfc0ad7c1f208a1eafa3..85a3e98100f6c993909bda43fadd9d4df01c84f9 100644 (file)
@@ -1718,7 +1718,7 @@ cp_fold_r (tree *stmt_p, int *walk_subtrees, void *data_)
 
     case TARGET_EXPR:
       if (!flag_no_inline
-         && (data->flags && ff_genericize))
+         && (data->flags & ff_genericize))
        if (tree &init = TARGET_EXPR_INITIAL (stmt))
          {
            tree folded = maybe_constant_init (init, TARGET_EXPR_SLOT (stmt),
index 14676e5dcea8830bb458f66dd7ab1409135c9321..7d14cc4f625f13ba5e6318ba7e400e83d6b9152a 100644 (file)
@@ -1,6 +1,6 @@
 // PR c++/124973
 // { dg-do compile { target c++20 } }
-// { dg-additional-options "-fmodules" }
+// { dg-additional-options "-fmodules -O" }
 
 export module left;            // { dg-module-cmi left }
 import right;