]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core.git/commit
gcc: Fix c++: tweak for Wrange-loop-construct
authorSunil Dora <sunilkumar.dora@windriver.com>
Wed, 11 Dec 2024 18:16:53 +0000 (10:16 -0800)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 13 Dec 2024 11:19:55 +0000 (11:19 +0000)
commit7c9402953d1e4eed4bd4427171e96761812f7478
treec74558a1948ec7e066aea6f67419183af1c2094a
parent5e3c6a6384fcdc4a2269172012caae14e5f327ca
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: Mathieu Dubois-Briand <mathieu.dubois-briand@bootlin.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
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]