https://gcc.gnu.org/bugzilla/show_bug.cgi?id=116954

--- Comment #8 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Jason Merrill
<ja...@gcc.gnu.org>:

https://gcc.gnu.org/g:1e91580d64932dffa87831ef403f5fb7a41b6f12

commit r14-11692-g1e91580d64932dffa87831ef403f5fb7a41b6f12
Author: Jason Merrill <ja...@redhat.com>
Date:   Wed Apr 16 11:15:14 2025 -0400

    c++: format attribute redeclaration [PR116954]

    Here when merging the two decls, remove_contract_attributes loses
    ATTR_IS_DEPENDENT on the format attribute, so
apply_late_template_attributes
    just returns, so the attribute doesn't get propagated to the type where the
    warning looks for it.

    Fixed by using copy_node instead of tree_cons to preserve flags.

            PR c++/116954

    gcc/cp/ChangeLog:

            * contracts.cc (remove_contract_attributes): Preserve flags
            on the attribute list.

    gcc/testsuite/ChangeLog:

            * g++.dg/warn/Wformat-3.C: New test.

    (cherry picked from commit b0d7d644f3c25af9bf60c948ab26aa7b09a68787)

Reply via email to