public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/109278] a note without a warning Date: Thu, 30 Mar 2023 07:35:02 +0000 [thread overview] Message-ID: <bug-109278-4-LwjGn8v6QV@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-109278-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109278 --- Comment #5 from CVS Commits <cvs-commit at gcc dot gnu.org> --- The master branch has been updated by Jakub Jelinek <jakub@gcc.gnu.org>: https://gcc.gnu.org/g:ee6ae8cb4793041590b479346433ed786a86985d commit r13-6941-gee6ae8cb4793041590b479346433ed786a86985d Author: Jakub Jelinek <jakub@redhat.com> Date: Thu Mar 30 09:34:12 2023 +0200 c++: Avoid informs without a warning [PR109278] On the following testcase we emit notes in maybe_inform_about_fndecl_for_bogus_argument_init despite no warning/error being printed before it. This is for the extended floating point type conversions where pedwarn is used, and complained is used there for 2 different purposes, one is whether an unspecific error should be emitted if we haven't complained otherwise, and one whether maybe_inform_about_fndecl_for_bogus_argument_init should be called. For the 2 pedwarns, currently it sets complained to true regardless of whether pedwarn succeeded, which results in the undesirable notes printed with -w. If complained is initialized to result of pedwarn, we would emit an error later on. So, the following patch makes complained a tristate, the additional error isn't printed if complained != 0, and maybe_inform_about_fndecl_for_bogus_argument_init is called only if complained == 1, so if pedwarn returns false, we can use complained = -1 to tell later code not to emit an error and not to call maybe_inform_about_fndecl_for_bogus_argument_init. 2023-03-30 Jakub Jelinek <jakub@redhat.com> PR c++/109278 * call.cc (convert_like_internal): If pedwarn for extended float type conversions doesn't report anything, avoid calling maybe_inform_about_fndecl_for_bogus_argument_init. * g++.dg/cpp23/ext-floating15.C: New test.
next prev parent reply other threads:[~2023-03-30 7:35 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-03-24 20:57 [Bug c++/109278] New: " pinskia at gcc dot gnu.org 2023-03-24 20:57 ` [Bug c++/109278] " pinskia at gcc dot gnu.org 2023-03-24 21:01 ` pinskia at gcc dot gnu.org 2023-03-24 21:34 ` jakub at gcc dot gnu.org 2023-03-24 21:42 ` jakub at gcc dot gnu.org 2023-03-30 7:35 ` cvs-commit at gcc dot gnu.org [this message] 2023-03-30 7:37 ` jakub at gcc dot gnu.org 2023-04-25 12:42 ` cvs-commit at gcc dot gnu.org 2023-04-26 8:37 ` cvs-commit at gcc dot gnu.org
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=bug-109278-4-LwjGn8v6QV@http.gcc.gnu.org/bugzilla/ \ --to=gcc-bugzilla@gcc.gnu.org \ --cc=gcc-bugs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).