aboutsummaryrefslogtreecommitdiff
path: root/gcc/ada/sem_prag.adb
diff options
context:
space:
mode:
authorRobert Dewar <dewar@adacore.com>2011-11-23 11:02:03 +0000
committerArnaud Charlet <charlet@gcc.gnu.org>2011-11-23 12:02:03 +0100
commitfb2bd3a70d29393806e9c21c9568de1170fee9f9 (patch)
tree7db57e1d95683f3bef8a703b838fa8e8f198edba /gcc/ada/sem_prag.adb
parenta1092b4889d054ba1f979e8a3e1672465610300c (diff)
downloadgcc-fb2bd3a70d29393806e9c21c9568de1170fee9f9.zip
gcc-fb2bd3a70d29393806e9c21c9568de1170fee9f9.tar.gz
gcc-fb2bd3a70d29393806e9c21c9568de1170fee9f9.tar.bz2
errout.adb: Minor reformattin (Finalize): Take templates into account for warning suppression.
2011-11-23 Robert Dewar <dewar@adacore.com> * errout.adb: Minor reformattin (Finalize): Take templates into account for warning suppression. * errout.ads (Set_Specific_Warning_Off): Add Used parameter. * erroutc.adb: Minor reformatting (Finalize): Take generic templates into account for warning suppress. * erroutc.ads (Set_Specific_Warning_Off): Add Used parameter. * sem_prag.adb: Minor reformatting (Analyze_Pragma, case Warnings): Provide Used parameter in call to Set_Specific_Warnings_Off (to deal with generic template case). From-SVN: r181658
Diffstat (limited to 'gcc/ada/sem_prag.adb')
-rw-r--r--gcc/ada/sem_prag.adb18
1 files changed, 14 insertions, 4 deletions
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index c63e9da..a21358b 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -14528,7 +14528,7 @@ package body Sem_Prag is
end;
end if;
- -- Two or more arguments (must be two)
+ -- Two or more arguments (must be two)
else
Check_Arg_Is_One_Of (Arg1, Name_On, Name_Off);
@@ -14547,8 +14547,7 @@ package body Sem_Prag is
-- the formal may be wrapped in a conversion if the
-- actual is a conversion. Retrieve the real entity name.
- if (In_Instance_Body
- or else In_Inlined_Body)
+ if (In_Instance_Body or else In_Inlined_Body)
and then Nkind (E_Id) = N_Unchecked_Type_Conversion
then
E_Id := Expression (E_Id);
@@ -14612,10 +14611,21 @@ package body Sem_Prag is
-- In any other case, an error will be signalled (ON
-- with no matching OFF).
+ -- Note: We set Used if we are inside a generic to
+ -- disable the test that the non-config case actually
+ -- cancels a warning. That's because we can't be sure
+ -- there isn't an instantiation in some other unit
+ -- where a warning is suppressed.
+
+ -- We could do a little better here by checking if the
+ -- generic unit we are inside is public, but for now
+ -- we don't bother with that refinement.
+
if Chars (Argx) = Name_Off then
Set_Specific_Warning_Off
(Loc, Name_Buffer (1 .. Name_Len),
- Config => Is_Configuration_Pragma);
+ Config => Is_Configuration_Pragma,
+ Used => Inside_A_Generic or else In_Instance);
elsif Chars (Argx) = Name_On then
Set_Specific_Warning_On