aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/debug.adb
diff options
context:
space:
mode:
authorEric Botcazou <ebotcazou@gcc.gnu.org>2020-07-02 10:26:49 +0200
committerEric Botcazou <ebotcazou@gcc.gnu.org>2020-07-02 10:29:34 +0200
commit6153cfd7a342f131d347de1aea87f352f3ccd4e7 (patch)
tree9c095d99c19e7bf2cd573a9ada4be774d39422c5 /gcc/ada/debug.adb
parentece21ff6ea9d969d3b6aae82136622a7126eefc1 (diff)
downloadgcc-6153cfd7a342f131d347de1aea87f352f3ccd4e7.zip
gcc-6153cfd7a342f131d347de1aea87f352f3ccd4e7.tar.gz
gcc-6153cfd7a342f131d347de1aea87f352f3ccd4e7.tar.bz2
Reject components in extensions overlapping with the parent
Such problematic components can be specified by means of a component clause but they cannot be fully supported by the type system. They had initially been forbidden, then we decided to accept them by working around the type system, but this is very fragile and, for example, any static aggregate is guaranteed to trigger an ICE with the current implementation. We now reject them again, except if the -gnatd.K switch is passed. gcc/ada/ChangeLog: * debug.adb (d.K): Document new usage. * fe.h (Debug_Flag_Dot_KK): Declare. * gcc-interface/decl.c (gnat_to_gnu_field): Give an error when the component overlaps with the parent subtype, except with -gnatd.K.
Diffstat (limited to 'gcc/ada/debug.adb')
-rw-r--r--gcc/ada/debug.adb7
1 files changed, 6 insertions, 1 deletions
diff --git a/gcc/ada/debug.adb b/gcc/ada/debug.adb
index 63b14b2..0f73c2a 100644
--- a/gcc/ada/debug.adb
+++ b/gcc/ada/debug.adb
@@ -128,7 +128,7 @@ package body Debug is
-- d.H
-- d.I Do not ignore enum representation clauses in CodePeer mode
-- d.J Relaxed rules for pragma No_Return
- -- d.K
+ -- d.K Do not reject components in extensions overlapping with parent
-- d.L Depend on back end for limited types in if and case expressions
-- d.M Relaxed RM semantics
-- d.N Add node to all entities
@@ -898,6 +898,11 @@ package body Debug is
-- for that. If the procedure does in fact return normally, execution
-- is erroneous, and therefore unpredictable.
+ -- d.K Do not reject components in extensions overlapping with the parent
+ -- component. Such components can be specified by means of a component
+ -- clause but they cannot be fully supported by the GCC type system.
+ -- This switch nevertheless allows them for the sake of compatibility.
+
-- d.L Normally the front end generates special expansion for conditional
-- expressions of a limited type. This debug flag removes this special
-- case expansion, leaving it up to the back end to handle conditional