From: Jason Merrill Date: Thu, 23 Apr 2026 13:20:57 +0000 (-0400) Subject: c++: fix typo in consteval, array, modules [PR124973] X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=99d8d4b3e69059b47b3d143f481b7f92a42eb0fe;p=thirdparty%2Fgcc.git c++: fix typo in consteval, array, modules [PR124973] 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. --- diff --git a/gcc/cp/cp-gimplify.cc b/gcc/cp/cp-gimplify.cc index 8ae66405817..85a3e98100f 100644 --- a/gcc/cp/cp-gimplify.cc +++ b/gcc/cp/cp-gimplify.cc @@ -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), diff --git a/gcc/testsuite/g++.dg/modules/consteval-1_b.C b/gcc/testsuite/g++.dg/modules/consteval-1_b.C index 14676e5dcea..7d14cc4f625 100644 --- a/gcc/testsuite/g++.dg/modules/consteval-1_b.C +++ b/gcc/testsuite/g++.dg/modules/consteval-1_b.C @@ -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;