aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_ch12.adb
diff options
context:
space:
mode:
authorArnaud Charlet <charlet@gcc.gnu.org>2012-04-02 11:19:30 +0200
committerArnaud Charlet <charlet@gcc.gnu.org>2012-04-02 11:19:30 +0200
commite228f7eed275e585d48c92dc87bde3dd0784e4d2 (patch)
treea214a8cf48a012e0c7fbd60901426ba6143aedaf /gcc/ada/sem_ch12.adb
parent99fc068ee807cc43779d775a3dda705f5f37c4f5 (diff)
downloadgcc-e228f7eed275e585d48c92dc87bde3dd0784e4d2.zip
gcc-e228f7eed275e585d48c92dc87bde3dd0784e4d2.tar.gz
gcc-e228f7eed275e585d48c92dc87bde3dd0784e4d2.tar.bz2
[multiple changes]
2012-04-02 Yannick Moy <moy@adacore.com> * lib-xref-alfa.adb: Code clean up. 2012-04-02 Ed Schonberg <schonberg@adacore.com> * sem_ch12.adb (Analyze_Subprogram_Instantiation): Do not suppress style checks, because the subprogram instance itself may contain violations of syle rules. * style.adb (Missing_Overriding): Check for missing overriding indicator on a subprogram instance. 2012-04-02 Hristian Kirtchev <kirtchev@adacore.com> * sem_ch6.adb (Last_Implicit_Declaration): New routine. (Process_PPCs): Insert the body of _postconditions after the last internally generated declaration. This ensures that actual subtypes created for formal parameters are visible and properly frozen as _postconditions may reference them. From-SVN: r186070
Diffstat (limited to 'gcc/ada/sem_ch12.adb')
-rw-r--r--gcc/ada/sem_ch12.adb17
1 files changed, 6 insertions, 11 deletions
diff --git a/gcc/ada/sem_ch12.adb b/gcc/ada/sem_ch12.adb
index 159594f..e516ec0 100644
--- a/gcc/ada/sem_ch12.adb
+++ b/gcc/ada/sem_ch12.adb
@@ -4404,9 +4404,6 @@ package body Sem_Ch12 is
Parent_Installed : Boolean := False;
Renaming_List : List_Id;
- Save_Style_Check : constant Boolean := Style_Check;
- -- Save style check mode for restore on exit
-
procedure Analyze_Instance_And_Renamings;
-- The instance must be analyzed in a context that includes the mappings
-- of generic parameters into actuals. We create a package declaration
@@ -4587,11 +4584,13 @@ package body Sem_Ch12 is
Instantiation_Node := N;
- -- Turn off style checking in instances. If the check is enabled on the
- -- generic unit, a warning in an instance would just be noise. If not
- -- enabled on the generic, then a warning in an instance is just wrong.
+ -- For package instantiations we turn off style checks, because they
+ -- will have been emitted in the generic. For subprogram instantiations
+ -- we want to apply at least the check on overriding indicators so we
+ -- do not modify the style check status.
- Style_Check := False;
+ -- The renaming declarations for the actuals do not come from source and
+ -- will not generate spurious warnings.
Preanalyze_Actuals (N);
@@ -4859,8 +4858,6 @@ package body Sem_Ch12 is
Generic_Renamings_HTable.Reset;
end if;
- Style_Check := Save_Style_Check;
-
<<Leave>>
if Has_Aspects (N) then
Analyze_Aspect_Specifications (N, Act_Decl_Id);
@@ -4875,8 +4872,6 @@ package body Sem_Ch12 is
if Env_Installed then
Restore_Env;
end if;
-
- Style_Check := Save_Style_Check;
end Analyze_Subprogram_Instantiation;
-------------------------