diff options
author | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-28 13:05:35 +0000 |
---|---|---|
committer | charlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4> | 2008-05-28 13:05:35 +0000 |
commit | 159f57c8342cd9feb7259a365838288cf2eeeabd (patch) | |
tree | fb31690627a5834458cdbda545cabae658c2046f /gcc/ada/sem_attr.adb | |
parent | e2793852c3d43623c06d60c76de6a0bed0eef25b (diff) | |
download | gcc-159f57c8342cd9feb7259a365838288cf2eeeabd.tar.gz |
2008-05-28 Robert Dewar <dewar@adacore.com>
* gnat_rm.texi: Add note on Old giving warning when applied to constant
* sem_attr.adb (Analyze_Attribute, case Old): Give warning if prefix is
a constant
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@136078 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_attr.adb')
-rw-r--r-- | gcc/ada/sem_attr.adb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/gcc/ada/sem_attr.adb b/gcc/ada/sem_attr.adb index 0cb2ace755e..14f9102d369 100644 --- a/gcc/ada/sem_attr.adb +++ b/gcc/ada/sem_attr.adb @@ -3501,6 +3501,13 @@ package body Sem_Attr is Error_Attr ("attribute % cannot apply to limited objects", P); end if; + if Is_Entity_Name (P) + and then Is_Constant_Object (Entity (P)) + then + Error_Msg_N + ("?attribute Old applied to constant has no effect", P); + end if; + -- Check that the expression does not refer to local entities Check_Local : declare |