aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@adacore.com>2018-11-14 11:41:53 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2018-11-14 11:41:53 +0000
commitbfb1147ca896f985a2268b7b6a0ba4b36394f8cc (patch)
tree805a003dcb59ae73a5739f8dce05a6af228c0cac /gcc/ada
parentb7c34dff67750bf38d8b8d89ea44c01d8c7c5870 (diff)
downloadgcc-bfb1147ca896f985a2268b7b6a0ba4b36394f8cc.zip
gcc-bfb1147ca896f985a2268b7b6a0ba4b36394f8cc.tar.gz
gcc-bfb1147ca896f985a2268b7b6a0ba4b36394f8cc.tar.bz2
[Ada] Fix assertion failure on pragma Compile_Time_Error in generic unit
There is no point in validating 'Alignment or 'Size of an entity declared in a generic unit after the back-end has been run, since such an entity is not passed to the back-end, and this can even lead to an assertion failure. 2018-11-14 Eric Botcazou <ebotcazou@adacore.com> gcc/ada/ * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't register a compile-time warning or error for 'Alignment or 'Size of an entity declared in a generic unit. gcc/testsuite/ * gnat.dg/compile_time_error1.adb, gnat.dg/compile_time_error1.ads, gnat.dg/compile_time_error1_pkg.ads: New testcase. From-SVN: r266127
Diffstat (limited to 'gcc/ada')
-rw-r--r--gcc/ada/ChangeLog6
-rw-r--r--gcc/ada/sem_prag.adb1
2 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index d4dcd8c..82329ac 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,3 +1,9 @@
+2018-11-14 Eric Botcazou <ebotcazou@adacore.com>
+
+ * sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Don't
+ register a compile-time warning or error for 'Alignment or 'Size
+ of an entity declared in a generic unit.
+
2018-11-14 Justin Squirek <squirek@adacore.com>
* sem_ch8.adb (Use_One_Package): Add test for out-of-scope
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index a96d148..cda8629 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -7545,6 +7545,7 @@ package body Sem_Prag is
begin
if Nkind (N) = N_Attribute_Reference
and then Is_Entity_Name (Prefix (N))
+ and then not Is_Generic_Unit (Scope (Entity (Prefix (N))))
then
declare
Attr_Id : constant Attribute_Id :=