aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2020-04-06 16:43:02 -0700
committerIan Lance Taylor <iant@golang.org>2020-04-06 16:43:02 -0700
commit42fd3e04ccbfbc47c1fddb15d384814637df0636 (patch)
treee2695726e95b7bd125d52b7bdd315cb0028854fa /gcc/ada
parent00eb71c43c74cc5143b60d470450c3981037ed3c (diff)
parent52fa80f853c0b0f623ea9e4c7198e324ce44ff30 (diff)
downloadgcc-42fd3e04ccbfbc47c1fddb15d384814637df0636.zip
gcc-42fd3e04ccbfbc47c1fddb15d384814637df0636.tar.gz
gcc-42fd3e04ccbfbc47c1fddb15d384814637df0636.tar.bz2
Merge from trunk revision 52fa80f853c0b0f623ea9e4c7198e324ce44ff30
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog5
-rw-r--r--gcc/ada/gcc-interface/decl.c9
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 64b2572..5349fd9 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,8 @@
+2020-03-11 Richard Wai <richard@annexi-strayline.com>
+
+ * gcc-interface/decl.c (gnat_to_gnu_entity): Also test Is_Public on
+ the Alias of the entitiy, if it is present, in the main assertion.
+
2020-02-06 Alexandre Oliva <oliva@adacore.com>
* raise-gcc.c (personality_body) [__ARM_EABI_UNWINDER__]:
diff --git a/gcc/ada/gcc-interface/decl.c b/gcc/ada/gcc-interface/decl.c
index 871a309..80dfc55 100644
--- a/gcc/ada/gcc-interface/decl.c
+++ b/gcc/ada/gcc-interface/decl.c
@@ -446,7 +446,12 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
/* If we get here, it means we have not yet done anything with this entity.
If we are not defining it, it must be a type or an entity that is defined
- elsewhere or externally, otherwise we should have defined it already. */
+ elsewhere or externally, otherwise we should have defined it already.
+
+ One exception is for an entity, typically an inherited operation, which is
+ a local alias for the parent's operation. It is neither defined, since it
+ is an inherited operation, nor public, since it is declared in the current
+ compilation unit, so we test Is_Public on the Alias entity instead. */
gcc_assert (definition
|| is_type
|| kind == E_Discriminant
@@ -454,6 +459,8 @@ gnat_to_gnu_entity (Entity_Id gnat_entity, tree gnu_expr, bool definition)
|| kind == E_Label
|| (kind == E_Constant && Present (Full_View (gnat_entity)))
|| Is_Public (gnat_entity)
+ || (Present (Alias (gnat_entity))
+ && Is_Public (Alias (gnat_entity)))
|| type_annotate_only);
/* Get the name of the entity and set up the line number and filename of