summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-07 08:52:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-01-07 08:52:35 +0000
commitcbd025d6205928a641e00d4ec35c8bc134703f9c (patch)
tree592729d84254e31b801ae9a4da1972998a95f2b4
parent5a74b7592a9dfad086b41e6a938fd0e11acd5e46 (diff)
downloadgcc-cbd025d6205928a641e00d4ec35c8bc134703f9c.tar.gz
2015-01-07 Javier Miranda <miranda@adacore.com>
* exp_disp.adb (Expand_Interface_Conversion): Adding missing generation of accessibility check. 2015-01-07 Ed Schonberg <schonberg@adacore.com> * sem_ch3.adb (Derived_Type_Declaration): In the case of an illegal completion from a class- wide type, set etype of the derived type properly to prevent cascaded errors. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@219283 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/ada/ChangeLog11
-rw-r--r--gcc/ada/exp_disp.adb5
-rw-r--r--gcc/ada/sem_ch3.adb5
3 files changed, 19 insertions, 2 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 25920e38cd1..b45007bd6f8 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,14 @@
+2015-01-07 Javier Miranda <miranda@adacore.com>
+
+ * exp_disp.adb (Expand_Interface_Conversion): Adding missing
+ generation of accessibility check.
+
+2015-01-07 Ed Schonberg <schonberg@adacore.com>
+
+ * sem_ch3.adb (Derived_Type_Declaration): In the case of an
+ illegal completion from a class- wide type, set etype of the
+ derived type properly to prevent cascaded errors.
+
2015-01-07 Robert Dewar <dewar@adacore.com>
* prj.ads, i-cpoint.adb, freeze.adb, ghost.adb, prj-err.adb: Minor
diff --git a/gcc/ada/exp_disp.adb b/gcc/ada/exp_disp.adb
index 3f999647413..4d07a3752bf 100644
--- a/gcc/ada/exp_disp.adb
+++ b/gcc/ada/exp_disp.adb
@@ -1422,6 +1422,11 @@ package body Exp_Disp is
if Is_Access_Type (Etype (Expression (N))) then
+ Apply_Accessibility_Check
+ (N => Expression (N),
+ Typ => Etype (N),
+ Insert_Node => N);
+
-- Generate: Func (Address!(Expression))
Rewrite (N,
diff --git a/gcc/ada/sem_ch3.adb b/gcc/ada/sem_ch3.adb
index 61be2f9b602..7757d6dda86 100644
--- a/gcc/ada/sem_ch3.adb
+++ b/gcc/ada/sem_ch3.adb
@@ -15860,11 +15860,12 @@ package body Sem_Ch3 is
Taggd := Is_Tagged_Type (Parent_Type);
- -- Perhaps the parent type should be changed to the class-wide type's
- -- specific type in this case to prevent cascading errors ???
+ -- Set the parent type to the class-wide type's specific type
+ -- in this case to prevent cascading errors
if Present (Extension) and then Is_Class_Wide_Type (Parent_Type) then
Error_Msg_N ("parent type must not be a class-wide type", Indic);
+ Set_Etype (T, Etype (Parent_Type));
return;
end if;