From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 435913858428; Thu, 30 Mar 2023 07:35:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 435913858428 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1680161703; bh=hh/QR/+xfcRrWepOHZS7snLxKd0dRnXxll0VxMCumAo=; h=From:To:Subject:Date:In-Reply-To:References:From; b=cAdOpCqDKyZIzTMGWwWL2O8OP79CaiDd0fUWhHIvvqbpg1W6a6a3IWg6fKf92Yqh0 uO1QIAHb5I3vg25h8L7NaQH0nmjVmmeR3aJIJpmbTtBg9TkEBmTZ2jQl4AB5mfMD77 TgSMsgovROZ8ci/t7yFzevDqm+9TWIJYl+rb1LlA= From: "cvs-commit at gcc dot 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 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 13.0 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: jakub at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D109278 --- Comment #5 from CVS Commits --- The master branch has been updated by Jakub Jelinek : https://gcc.gnu.org/g:ee6ae8cb4793041590b479346433ed786a86985d commit r13-6941-gee6ae8cb4793041590b479346433ed786a86985d Author: Jakub Jelinek 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 print= ed 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 !=3D 0, and maybe_inform_about_fndecl_for_bogus_argument_init is called only if complained =3D=3D 1, so if pedwarn returns false, we can use complained= =3D -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 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.=