aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Duff <duff@adacore.com>2019-08-14 09:51:57 +0000
committerPierre-Marie de Rodat <pmderodat@gcc.gnu.org>2019-08-14 09:51:57 +0000
commit3a02b4697e38e506c2856c104261cfe87550548a (patch)
tree63456a74e889d13b3259a2c0433e0b8f1222fb63
parent6d0ca6acd0616ddac74d23c0bec3791e6c721142 (diff)
downloadgcc-3a02b4697e38e506c2856c104261cfe87550548a.zip
gcc-3a02b4697e38e506c2856c104261cfe87550548a.tar.gz
gcc-3a02b4697e38e506c2856c104261cfe87550548a.tar.bz2
[Ada] Tweak the sloc of Compile_Time_Warning warnings
2019-08-14 Bob Duff <duff@adacore.com> gcc/ada/ * sem_prag.adb (Validate_Compile_Time_Warning_Error): Attach the warning to the Sloc of the first pragma argument, rather than to the pragma itself. This is to make pragmas processed after the back end use the same Sloc as pragmas processed earlier, in the front end. There's no reason for this discrepancy, and it hinders further work on this ticket. From-SVN: r274461
-rw-r--r--gcc/ada/ChangeLog9
-rw-r--r--gcc/ada/sem_prag.adb7
2 files changed, 13 insertions, 3 deletions
diff --git a/gcc/ada/ChangeLog b/gcc/ada/ChangeLog
index 42d342f..773b705 100644
--- a/gcc/ada/ChangeLog
+++ b/gcc/ada/ChangeLog
@@ -1,5 +1,14 @@
2019-08-14 Bob Duff <duff@adacore.com>
+ * sem_prag.adb (Validate_Compile_Time_Warning_Error): Attach the
+ warning to the Sloc of the first pragma argument, rather than to
+ the pragma itself. This is to make pragmas processed after the
+ back end use the same Sloc as pragmas processed earlier, in the
+ front end. There's no reason for this discrepancy, and it
+ hinders further work on this ticket.
+
+2019-08-14 Bob Duff <duff@adacore.com>
+
* sem.ads (Inside_A_Generic): Remove the ??? comment.
2019-08-14 Eric Botcazou <ebotcazou@adacore.com>
diff --git a/gcc/ada/sem_prag.adb b/gcc/ada/sem_prag.adb
index 0f822bf..1db39f4 100644
--- a/gcc/ada/sem_prag.adb
+++ b/gcc/ada/sem_prag.adb
@@ -336,8 +336,8 @@ package body Sem_Prag is
-- and alignment values performed by the back end.
-- Note: the reason we store a Source_Ptr value instead of a Node_Id is
- -- that by the time Validate_Unchecked_Conversions is called, Sprint will
- -- already have modified all Sloc values if the -gnatD option is set.
+ -- that by the time Validate_Compile_Time_Warning_Errors is called, Sprint
+ -- will already have modified all Sloc values if the -gnatD option is set.
type CTWE_Entry is record
Eloc : Source_Ptr;
@@ -32147,9 +32147,10 @@ package body Sem_Prag is
-----------------------------------------
procedure Validate_Compile_Time_Warning_Error (N : Node_Id) is
+ Arg1 : constant Node_Id := First (Pragma_Argument_Associations (N));
begin
Compile_Time_Warnings_Errors.Append
- (New_Val => CTWE_Entry'(Eloc => Sloc (N),
+ (New_Val => CTWE_Entry'(Eloc => Sloc (Arg1),
Scope => Current_Scope,
Prag => N));
end Validate_Compile_Time_Warning_Error;