aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorHristian Kirtchev <kirtchev@adacore.com>2019-07-08 08:14:27 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-07-08 08:14:27 +0000
commit570d5bbc7b7c5f7eb0eb03660a93687a6698ae7e (patch)
tree01098a79c7af2350fd4b1f213ff5cce95ebd8006 /gcc/ada
parent47bcd81fe7f8f9251f0777ae5ee77520b615af26 (diff)
downloadgcc-570d5bbc7b7c5f7eb0eb03660a93687a6698ae7e.zip
gcc-570d5bbc7b7c5f7eb0eb03660a93687a6698ae7e.tar.gz
gcc-570d5bbc7b7c5f7eb0eb03660a93687a6698ae7e.tar.bz2
[Ada] Assertion failure on validity check for Address
This patch corrects the verification of 'Address clauses to avoid processing a clause where the prefix of the attribute is a generic formal object. 2019-07-08 Hristian Kirtchev <kirtchev@adacore.com> gcc/ada/ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not register an address clause when its prefix denotes a generic formal object. gcc/testsuite/ * gnat.dg/addr13.adb, gnat.dg/addr13.ads: New testcase. From-SVN: r273218
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_ch13.adb1
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index cc8978d..b122428 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,11 @@
2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
+ * sem_ch13.adb (Analyze_Attribute_Definition_Clause): Do not
+ register an address clause when its prefix denotes a generic
+ formal object.
+
+2019-07-08 Hristian Kirtchev <kirtchev@adacore.com>
+
* bindo-diagnostics.adb (Diagnose_Cycle): Capture the presence
of an Elaborate_All edge before iterating over the edges of the
cycle.
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 76639cd..cbae9c8 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -5145,6 +5145,7 @@ package body Sem_Ch13 is
-- aspect case properly.
if Is_Object (O_Ent)
+ and then not Is_Generic_Formal (O_Ent)
and then not Is_Generic_Type (Etype (U_Ent))
and then Address_Clause_Overlay_Warnings
then