diff options
author | Samuel Tardieu <sam@rfc1149.net> | 2007-11-13 19:12:57 +0000 |
---|---|---|
committer | Samuel Tardieu <sam@gcc.gnu.org> | 2007-11-13 19:12:57 +0000 |
commit | 66beb09b045130f9516b110d5cf41c81f8396be6 (patch) | |
tree | 3cddc726ff00da8ec64bf66517cacc3d804d3b70 /gcc | |
parent | 046e40718070e75485fd70ff7d4349596bb7630a (diff) | |
download | gcc-66beb09b045130f9516b110d5cf41c81f8396be6.zip gcc-66beb09b045130f9516b110d5cf41c81f8396be6.tar.gz gcc-66beb09b045130f9516b110d5cf41c81f8396be6.tar.bz2 |
sem_prag.adb (Process_Convention): Move the test for the entity on which the Convention pragma applies down to...
gcc/ada/
* sem_prag.adb (Process_Convention): Move the test for the
entity on which the Convention pragma applies down to also
forbid pragma Convention on enumeration literals reached
through renamings.
From-SVN: r130155
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ada/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/ada/sem_prag.adb | 8 |
2 files changed, 9 insertions, 4 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog index 1e8cd52..1c60120 100644 --- a/gcc/ada/ChangeLog +++ b/gcc/ada/ChangeLog @@ -4,6 +4,11 @@ explaining why in general 'Unchecked_Access must be used instead of 'Access. + * sem_prag.adb (Process_Convention): Move the test for the + entity on which the Convention pragma applies down to also + forbid pragma Convention on enumeration literals reached + through renamings. + 2007-11-10 Samuel Tardieu <sam@rfc1149.net> * a-tasatt.adb: Revert previous change for this file as it will diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb index 65ee287..8195c8b 100644 --- a/gcc/ada/sem_prag.adb +++ b/gcc/ada/sem_prag.adb @@ -2219,10 +2219,6 @@ package body Sem_Prag is Error_Pragma_Arg ("entity name required", Arg2); end if; - if Ekind (Entity (Id)) = E_Enumeration_Literal then - Error_Pragma ("enumeration literal not allowed for pragma%"); - end if; - E := Entity (Id); -- Go to renamed subprogram if present, since convention applies to @@ -2267,6 +2263,10 @@ package body Sem_Prag is ("\supply appropriate type for&!", Arg2); end if; + if Ekind (E) = E_Enumeration_Literal then + Error_Pragma ("enumeration literal not allowed for pragma%"); + end if; + if Etype (E) = Any_Type or else Rep_Item_Too_Early (E, N) then |