aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2016-07-04 12:41:23 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2016-07-04 12:41:23 +0200
commitc70cf4f8eb5bf8623e0f89eef6aabf308ef04c1b (patch)
tree6a188b38ec6a6d1cceaa5cfec8b67421cf83d596 /gcc/ada/sem_ch12.adb
parentd4b56371aab8d056fc3ad7d1aa4d3f76f0e839d1 (diff)
downloadgcc-c70cf4f8eb5bf8623e0f89eef6aabf308ef04c1b.zip
gcc-c70cf4f8eb5bf8623e0f89eef6aabf308ef04c1b.tar.gz
gcc-c70cf4f8eb5bf8623e0f89eef6aabf308ef04c1b.tar.bz2
[multiple changes]
2016-07-04 Hristian Kirtchev <kirtchev@adacore.com> * freeze.adb, ghost.adb, sem_ch13.adb: Minor reformatting. 2016-07-04 Pascal Obry <obry@adacore.com> * g-forstr.ads: More documentation for the Formatted_String support. 2016-07-04 Justin Squirek <squirek@adacore.com> * sem_ch7.adb (Install_Parent_Private_Declarations): When instantiating a child unit, do not install private declaration of a non-generic ancestor of the generic that is also an ancestor of the current unit: its private part will be installed when private part of ancestor itself is analyzed. 2016-07-04 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Instantiate_Object): In SPARK mode add a guard to verify that the actual is an object reference before checking for volatility. (Check_Generic_Child_Unit): Prevent cascaded errors when prefix is illegal. From-SVN: r237969
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb25
1 files changed, 16 insertions, 9 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 1b48077..3648146 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -6695,17 +6695,23 @@ package body Sem_Ch12 is
elsif Nkind (Gen_Id) = N_Expanded_Name then
- -- Entity already present, analyze prefix, whose meaning may be
- -- an instance in the current context. If it is an instance of
- -- a relative within another, the proper parent may still have
- -- to be installed, if they are not of the same generation.
+ -- Entity already present, analyze prefix, whose meaning may be an
+ -- instance in the current context. If it is an instance of a
+ -- relative within another, the proper parent may still have to be
+ -- installed, if they are not of the same generation.
Analyze (Prefix (Gen_Id));
- -- In the unlikely case that a local declaration hides the name
- -- of the parent package, locate it on the homonym chain. If the
- -- context is an instance of the parent, the renaming entity is
- -- flagged as such.
+ -- Prevent cascaded errors
+
+ if Etype (Prefix (Gen_Id)) = Any_Type then
+ return;
+ end if;
+
+ -- In the unlikely case that a local declaration hides the name of
+ -- the parent package, locate it on the homonym chain. If the context
+ -- is an instance of the parent, the renaming entity is flagged as
+ -- such.
Inst_Par := Entity (Prefix (Gen_Id));
while Present (Inst_Par)
@@ -10681,10 +10687,11 @@ package body Sem_Ch12 is
-- An effectively volatile object cannot be used as an actual in a
-- generic instantiation (SPARK RM 7.1.3(7)). The following check is
-- relevant only when SPARK_Mode is on as it is not a standard Ada
- -- legality rule.
+ -- legality rule, and also verifies that the actual is an object.
if SPARK_Mode = On
and then Present (Actual)
+ and then Is_Object_Reference (Actual)
and then Is_Effectively_Volatile_Object (Actual)
then
Error_Msg_N