Backport: Fix c++: tweak for Wrange-loop-construct
PATCH 1/1 Backport: Fix c++: tweak for Wrange-loop-construct
From: Sunil Dora <[email protected]>
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]
Upstream-Status: Backport [https://gcc.gnu.org/g:6ac4e2f4b2ca9980670e7d3815a9140730df1005]
--- meta/recipes-devtools/gcc/gcc-14.2.inc | 1 + ...ix-c-tweak-for-Wrange-loop-construct.patch | 114 ++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 meta/recipes-devtools/gcc/gcc/0026-Backport-Fix-c-tweak-for-Wrange-loop-construct.patch
meta/recipes-devtools/gcc/gcc-14.2.inc +1 -0
@@ -68,6 +68,7 @@ SRC_URI = "${BASEURI} \ file://0023-Fix-install-path-of-linux64.h.patch \ file://0024-Avoid-hardcoded-build-paths-into-ppc-libgcc.patch \ file://0025-gcc-testsuite-tweaks-for-mips-OE.patch \ + file://0026-Backport-Fix-c-tweak-for-Wrange-loop-construct.patch \ file://gcc.git-ab884fffe3fc82a710bea66ad651720d71c938b8.patch \ "
meta/recipes-devtools/gcc/gcc/0026-Backport-Fix-c-tweak-for-Wrange-loop-construct.patch new file +114 -0
114 lines not on this page · raw message
Signature · 1 line
2.43.0
Steve,
Ignore this one, a v2 has been submitted.
Sunil,
Please follow-up on your own patches like this to help people know that they should ignore a patch that you have sent. Steve has 10s of emails or more to deal with so clear instructions are helpful.
For future commit revisions, please also indicate that the patch is v2, v3 again, so that anyone reading your thread can follow along. Some people even thread follow-ups to the initial commit using --in-reply-to=<identifier> but that's not required.
You can use:
git send-email ... --subject-prefix="branch-foo][PATCH v2" See:
https://lore.kernel.org/openembedded-core/?q=v2
and:
https://docs.yoctoproject.org/contributor-guide/submit-changes.html#sending-patches-via-email
Thanks,
../Randy
Quoted 26 lines · On 2024-12-11 12:22 p.m., [email protected] wrote:
From: Sunil Dora<[email protected]>
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/47355PR c++/116731 [https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116731]
Upstream-Status: Backport [https://gcc.gnu.org/g:6ac4e2f4b2ca9980670e7d3815a9140730df1005]
Signed-off-by Marek Polacek<[email protected]>Signed-off-by Sunil Dora<[email protected]>--- meta/recipes-devtools/gcc/gcc-14.2.inc | 1 + ...ix-c-tweak-for-Wrange-loop-construct.patch | 114 ++++++++++++++++++ 2 files changed, 115 insertions(+)create mode 100644
meta/recipes-devtools/gcc/gcc/0026-Backport-Fix-c-tweak-for-Wrange-loop-construct.patchmeta/recipes-devtools/gcc/gcc-14.2.inc +0
-0
Signature · 2 lines
# Randy MacLeod # Wind River Linux