aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2022-01-05 20:57:14 -0800
committerIan Lance Taylor <iant@golang.org>2022-01-06 11:24:11 -0800
commitbe129ca481c2e9c06ba40957b955a5c5765b7c87 (patch)
treeb1a776914f5cb0be6649f10c44c1d032d062d052
parent0d03db068c89d46bc62ec79395708fd19f09d3d8 (diff)
downloadgcc-be129ca481c2e9c06ba40957b955a5c5765b7c87.zip
gcc-be129ca481c2e9c06ba40957b955a5c5765b7c87.tar.gz
gcc-be129ca481c2e9c06ba40957b955a5c5765b7c87.tar.bz2
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
-rw-r--r--gcc/go/gofrontend/MERGE2
-rw-r--r--gcc/go/gofrontend/types.cc3
2 files changed, 2 insertions, 3 deletions
diff --git a/gcc/go/gofrontend/MERGE b/gcc/go/gofrontend/MERGE
index a18f3a3..9cc6a1c 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 57c02a9..1c67ea0 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