From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 58B7B3858CD1; Wed, 20 Mar 2024 15:45:41 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 58B7B3858CD1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1710949541; bh=k1HjvOVsF82LLtgWk/tLco6a9mP4tIldkzUgI2v0LiU=; h=From:To:Subject:Date:In-Reply-To:References:From; b=aeo6sdrJG5lsT+VMe3ZCe3qJxqNk3yg+bQ2sLpCCwlGkl5Sq+L5Y4/aNwKj0hLpfm T3L7V0GEMnj1E7Y+pcxLkBMKZRLwsXEHfEqS0Tya3ClzAvJCEqCc94I1uiUxG/TBJs ZGneXKLy4n/cZ2HkeE+tvGnoIkXQcVhPDVej9Ya4= From: "cvs-commit at gcc dot gnu.org" To: gdb-prs@sourceware.org Subject: [Bug c++/15398] Incorrect "cannot resolve function" error when argument is a pointer to fixed size array (regression: worked with 7.2) Date: Wed, 20 Mar 2024 15:45:39 +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: 7.5 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: ASSIGNED X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: keiths at redhat dot com 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=3D15398 --- Comment #5 from Sourceware Commits --- The master branch has been updated by Hannes Domani : https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D105470cd79f6= d8c62b9156ce45e992895b01b13b commit 105470cd79f6d8c62b9156ce45e992895b01b13b Author: Hannes Domani Date: Mon Dec 25 19:05:55 2023 +0100 Fix comparison of array types Currently it's not possible to call functions if an argument is a pointer to an array: ``` (gdb) l f 1 int f (int (*x)[2]) 2 { 3 return x[0][1]; 4 } 5 6 int main() 7 { 8 int a[2][2] =3D {{0, 1}, {2, 3}}; 9 return f (a); 10 } (gdb) p f(a) Cannot resolve function f to any overloaded instance ``` This happens because types_equal doesn't handle array types, so the function is never even considered as a possibility. With array type handling added, by comparing element types and array bounds, the same works: ``` (gdb) p f(a) $1 =3D 1 ``` Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=3D15398 Co-Authored-By: Keith Seitz Reviewed-By: Guinevere Larsen Approved-By: Tom Tromey --=20 You are receiving this mail because: You are on the CC list for the bug.=