aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch13.adb
diff options
context:
space:
mode:
authorPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-11-16 12:53:46 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2017-11-16 12:53:46 +0000
commit403bc026aca65b22159955dd4df81eb9b2b407f4 (patch)
treeb5ccb349700ab5ea7b86455fb4cc5c9e15564ff6 /gcc/ada/sem_ch13.adb
parentc757ad4cf61f982a05cb5f424308ec199aa2923d (diff)
downloadgcc-403bc026aca65b22159955dd4df81eb9b2b407f4.zip
gcc-403bc026aca65b22159955dd4df81eb9b2b407f4.tar.gz
gcc-403bc026aca65b22159955dd4df81eb9b2b407f4.tar.bz2
[multiple changes]
2017-11-16 Sylvain Dailler <dailler@adacore.com> * sem_util.adb (Get_Enum_Lit_From_Pos): Add a condition for Pos lower than 0. 2017-11-16 Bob Duff <duff@adacore.com> * sem_ch13.adb (Check_Expr_Constants): Avoid error message in case of System'To_Address. From-SVN: r254818
Diffstat (limited to 'gcc/ada/sem_ch13.adb')
-rw-r--r--gcc/ada/sem_ch13.adb9
1 files changed, 9 insertions, 0 deletions
diff --git a/gcc/ada/sem_ch13.adb b/gcc/ada/sem_ch13.adb
index 83d3108..b501e14 100644
--- a/gcc/ada/sem_ch13.adb
+++ b/gcc/ada/sem_ch13.adb
@@ -9783,6 +9783,15 @@ package body Sem_Ch13 is
then
Check_At_Constant_Address (Prefix (Nod));
+ -- Normally, System'To_Address will have been transformed into
+ -- an Unchecked_Conversion, but in -gnatc mode, it will not,
+ -- and we don't want to give an error, because the whole point
+ -- of 'To_Address is that it is static.
+
+ elsif Attribute_Name (Nod) = Name_To_Address then
+ pragma Assert (Operating_Mode = Check_Semantics);
+ null;
+
else
Check_Expr_Constants (Prefix (Nod));
Check_List_Constants (Expressions (Nod));