aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEd Schonberg <schonberg@adacore.com>2015-10-16 10:28:37 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2015-10-16 12:28:37 +0200
commit251b6a477e97787533753da196dc6e9640359a5a (patch)
treeb8a940922c583868d74bb26e3f7234adaf9f5c5c
parent74e3c262622d61ee507eaf6000537cc4cd39b907 (diff)
downloadgcc-251b6a477e97787533753da196dc6e9640359a5a.zip
gcc-251b6a477e97787533753da196dc6e9640359a5a.tar.gz
gcc-251b6a477e97787533753da196dc6e9640359a5a.tar.bz2
sem_util.adb (Gather_Components): When gathering components of a nested variant...
2015-10-16 Ed Schonberg <schonberg@adacore.com> * sem_util.adb (Gather_Components): When gathering components of a nested variant, the record type used in legality checks is the enclosing record type. From-SVN: r228865
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_util.adb13
2 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 9effe45..e31645e 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2015-10-16 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_util.adb (Gather_Components): When gathering components
+ of a nested variant, the record type used in legality checks is
+ the enclosing record type.
+
2015-10-13 Jakub Jelinek <jakub@redhat.com>
* gcc-interface/utils.c (DEF_FUNCTION_TYPE_9, DEF_FUNCTION_TYPE_10,
diff --git a/gcc/ada/sem_util.adb b/gcc/ada/sem_util.adb
index a29b286..56f4d93 100644
--- a/gcc/ada/sem_util.adb
+++ b/gcc/ada/sem_util.adb
@@ -7292,10 +7292,11 @@ package body Sem_Util is
end if;
-- If we have found the corresponding choice, recursively add its
- -- components to the Into list.
+ -- components to the Into list. The nested components are part of
+ -- the same record type.
Gather_Components
- (Empty, Component_List (Variant), Governed_By, Into, Report_Errors);
+ (Typ, Component_List (Variant), Governed_By, Into, Report_Errors);
end Gather_Components;
------------------------
@@ -16998,7 +16999,7 @@ package body Sem_Util is
begin
-- This is a private type which is not completed yet. This can only
-- happen in a default expression (of a formal parameter or of a
- -- record component). Do not expand transient scope in this case
+ -- record component). Do not expand transient scope in this case.
if No (Typ) then
return False;
@@ -17104,9 +17105,9 @@ package body Sem_Util is
-- nondiscriminants). That is, the recursive calls are too conservative.
function Has_Discrim_Dep_Array (Typ : Entity_Id) return Boolean;
- -- True if we find certain discriminant-dependent array
- -- subcomponents. This shouldn't be necessary, but without this check,
- -- we crash in gimplify. ???
+ -- True if we find certain discriminant-dependent array subcomponents.
+ -- This shouldn't be necessary, but without this check, we crash in
+ -- gimplify. ???
function Caller_Known_Size_Record (Typ : Entity_Id) return Boolean is
pragma Assert (Typ = Underlying_Type (Typ));