From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 5B848383B41F; Fri, 6 Aug 2021 03:27:51 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 5B848383B41F From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/52288] operator?: and lambdas error message could be better Date: Fri, 06 Aug 2021 03:27:50 +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: 4.6.1 X-Bugzilla-Keywords: diagnostic X-Bugzilla-Severity: enhancement X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status everconfirmed cf_reconfirmed_on short_desc 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 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 06 Aug 2021 03:27:51 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D52288 Andrew Pinski changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 Last reconfirmed| |2021-08-06 Summary|Trouble with operator?: and |operator?: and lambdas |lambdas |error message could be | |better --- Comment #7 from Andrew Pinski --- (In reply to Jason Merrill from comment #6) > G++ will now say >=20 > wa.C:3:17: error: operands to ?: have different types =E2=80=98main(int, > char**)::=E2=80=99 and =E2=80=98main(int, char**)::=E2=80=99 >=20 > I think that addresses the ?: part of this issue. I'll leave it open for > now in case we want to keep it as a question about how to name lambdas in > error messages. It seems to me that we might want to omit the function > scope if we're currently in the same function. Do we want to give them > numbers to distinguish them? This is how clang does their names of the lambdas in error message: :4:17: error: incompatible operand types ('(lambda at :4:19= )' and '(lambda at :5:9)') void* p =3D b ? [argc](int i){ return i; } : ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~ Maybe we can do the same.=