summaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
authorcharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:19:35 +0000
committercharlet <charlet@138bc75d-0d04-0410-961f-82ee72b054a4>2015-10-23 12:19:35 +0000
commit05805eb6431552481d074dd935938cbddb3a8058 (patch)
treee0a7e50503fba5672f4b7d39a36b225374738a8d /gcc/ada/sem_prag.adb
parent9003096f2dafa5559169d2710c442a11adf1d548 (diff)
downloadgcc-05805eb6431552481d074dd935938cbddb3a8058.tar.gz
2015-10-23 Hristian Kirtchev <kirtchev@adacore.com>
* sem_prag.adb (Analyze_Pragma): Pragma Volatile_Function should not apply to a function instantiation. * sem_util.adb (Has_Effectively_Volatile_Profile): New routine. (Is_Volatile_Function): An instance of Ada.Unchecked_Conversion is a volatile function when its profile contains an effectively volatile type. * sem_util.ads (Has_Effectively_Volatile_Profile): New routine. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@229238 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb10
1 files changed, 3 insertions, 7 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index d7b588352c1..b9526747a86 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -21543,14 +21543,9 @@ package body Sem_Prag is
Subp_Decl :=
Find_Related_Subprogram_Or_Body (N, Do_Checks => True);
- -- Function instantiation
-
- if Nkind (Subp_Decl) = N_Function_Instantiation then
- null;
-
-- Generic subprogram
- elsif Nkind (Subp_Decl) = N_Generic_Subprogram_Declaration then
+ if Nkind (Subp_Decl) = N_Generic_Subprogram_Declaration then
null;
-- Body acts as spec
@@ -21578,7 +21573,6 @@ package body Sem_Prag is
end if;
Spec_Id := Corresponding_Spec_Of (Subp_Decl);
- Over_Id := Overridden_Operation (Spec_Id);
if not Ekind_In (Spec_Id, E_Function, E_Generic_Function) then
Pragma_Misplaced;
@@ -21595,6 +21589,8 @@ package body Sem_Prag is
-- in New_Overloaded_Entity, however at that point the pragma has
-- not been processed yet.
+ Over_Id := Overridden_Operation (Spec_Id);
+
if Present (Over_Id)
and then not Is_Volatile_Function (Over_Id)
then