From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 50A5B3861823; Thu, 14 Dec 2023 15:19:24 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 50A5B3861823 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1702567164; bh=fvhrG/SQxDo4iX1f5NoiYuMYdNzH3dFpAQCUyDoBlzA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=w/rCow0YxlAGKRnedN3VGJtN/EdPUrCFNzmtPnzeI/RtbUmPOu0S/6OUSON/mEXOi ev9ffwBze1VUXnqjFAaIj05GglqhWKbhuSUCd8LHMORkMkw94E+9yPKyjrFoPSG816 V7bQEMbm1JCm/U9haGPGSeGBcOJ1bjGsRpFuY8H0= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug c++/28589] cannot call a variadic C++ function Date: Thu, 14 Dec 2023 15:19:23 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gdb X-Bugzilla-Component: c++ X-Bugzilla-Version: unknown X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot 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://sourceware.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 List-Id: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28589 --- Comment #1 from Sourceware Commits --- The master branch has been updated by Hannes Domani : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D1d2f86b6b74e= 6caae77951353a4c353ce9816374 commit 1d2f86b6b74e6caae77951353a4c353ce9816374 Author: Hannes Domani Date: Sun Nov 14 16:19:31 2021 +0100 Allow calling of variadic C++ functions Currently, it's not possible to call a variadic C++ function: ``` (gdb) print sum_vararg_int(1, 10) Cannot resolve function sum_vararg_int to any overloaded instance (gdb) print sum_vararg_int(2, 20, 30) Cannot resolve function sum_vararg_int to any overloaded instance ``` It's because all additional arguments get the TOO_FEW_PARAMS_BADNESS rank by rank_function, which disqualifies the function. To fix this, I've created the new VARARG_BADNESS rank, which is used only for additional arguments of variadic functions, allowing them to be called: ``` (gdb) print sum_vararg_int(1, 10) $1 =3D 10 (gdb) print sum_vararg_int(2, 20, 30) $2 =3D 50 ``` Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D28589 Approved-By: Tom Tromey --=20 You are receiving this mail because: You are on the CC list for the bug.=