]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commit
gcc: Fix c++: tweak for Wrange-loop-construct
authorSunil Dora <sunilkumar.dora@windriver.com>
Wed, 11 Dec 2024 18:15:12 +0000 (10:15 -0800)
committerSteve Sakoman <steve@sakoman.com>
Thu, 26 Dec 2024 14:18:22 +0000 (06:18 -0800)
commitb8260e5aca93a7000001013f8a950fb040141588
tree81b9556c39bb9d6a6ce11d93b19dbb36d7fce49e
parent5dd1fdf4c3e8596c4e7c8cd57d371c2c1d4b0843
gcc: Fix c++: tweak for Wrange-loop-construct

This commit updates the warning to use a check for "trivially constructible" instead of
"trivially copyable." The original check was incorrect, as "trivially copyable" only applies
to types that can be copied trivially, whereas "trivially constructible" is the correct check
for types that can be trivially default-constructed.

This change ensures the warning is more accurate and aligns with the proper type traits.

LLVM accepted a similar fix:
https://github.com/llvm/llvm-project/issues/47355

PR c++/116731 [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116731]

Signed-off-by: Marek Polacek <polacek@redhat.com>
Signed-off-by: Sunil Dora <sunilkumar.dora@windriver.com>
Signed-off-by: Steve Sakoman <steve@sakoman.com>
meta/recipes-devtools/gcc/gcc-14.2.inc
meta/recipes-devtools/gcc/gcc/0026-gcc-Fix-c-tweak-for-Wrange-loop-construct.patch [new file with mode: 0644]