From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2116) id 0D7823858430; Thu, 6 Jan 2022 19:24:18 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 0D7823858430 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Ian Lance Taylor To: gcc-cvs@gcc.gnu.org Subject: [gcc r12-6319] compiler: permit converting unnamed types when ignoring struct tags X-Act-Checkin: gcc X-Git-Author: Ian Lance Taylor X-Git-Refname: refs/heads/master X-Git-Oldrev: 0d03db068c89d46bc62ec79395708fd19f09d3d8 X-Git-Newrev: be129ca481c2e9c06ba40957b955a5c5765b7c87 Message-Id: <20220106192418.0D7823858430@sourceware.org> Date: Thu, 6 Jan 2022 19:24:18 +0000 (GMT) X-BeenThere: gcc-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Jan 2022 19:24:18 -0000 https://gcc.gnu.org/g:be129ca481c2e9c06ba40957b955a5c5765b7c87 commit r12-6319-gbe129ca481c2e9c06ba40957b955a5c5765b7c87 Author: Ian Lance Taylor Date: Wed Jan 5 20:57:14 2022 -0800 compiler: permit converting unnamed types when ignoring struct tags Test case is https://golang.org/cl/375796. Fixes golang/go#50439 Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/375797 Diff: --- gcc/go/gofrontend/MERGE | 2 +- gcc/go/gofrontend/types.cc | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE index a18f3a37349..9cc6a1c63c6 100644 --- a/gcc/go/gofrontend/MERGE +++ b/gcc/go/gofrontend/MERGE @@ -1,4 +1,4 @@ -9732b0766667b9235d0f35d0fb0abfe406b94d49 +799e9807c36fc661b14dfff136369556f09a5ebf The first line of this file holds the git revision number of the last merge done from the gofrontend repository. diff --git a/gcc/go/gofrontend/types.cc b/gcc/go/gofrontend/types.cc index 57c02a97ef0..1c67ea099eb 100644 --- a/gcc/go/gofrontend/types.cc +++ b/gcc/go/gofrontend/types.cc @@ -791,8 +791,7 @@ Type::are_convertible(const Type* lhs, const Type* rhs, std::string* reason) // The types are convertible if they have identical underlying // types, ignoring struct field tags. - if ((lhs->named_type() != NULL || rhs->named_type() != NULL) - && Type::are_identical(lhs->base(), rhs->base(), 0, reason)) + if (Type::are_identical(lhs->base(), rhs->base(), 0, reason)) return true; // The types are convertible if they are both unnamed pointer types