+2018-01-11 Justin Squirek <squirek@adacore.com>
+
+ * sem_prag.adb (Analyze_Pragma:Pragma_Loop_Variant): Modify error
+ message to be printed on the pragma argument identifier.
+
2018-01-11 Hristian Kirtchev <kirtchev@adacore.com>
* exp_util.adb (Build_Invariant_Procedure_Declaration): Set the last
Variant := First (Pragma_Argument_Associations (N));
while Present (Variant) loop
if Chars (Variant) = No_Name then
- Error_Pragma_Arg ("expect name `Increases`", Variant);
+ Error_Pragma_Arg_Ident ("expect name `Increases`", Variant);
elsif not Nam_In (Chars (Variant), Name_Decreases,
Name_Increases)
+2018-01-11 Justin Squirek <squirek@adacore.com>
+
+ * gnat.dg/loopvar.adb: New testcase.
+
2018-01-10 Jan Hubicka <hubicka@ucw.cz>
PR middle-end/83189
--- /dev/null
+-- { dg-do compile }
+
+procedure Loopvar (S : String) is
+ J : Integer := S'First;
+begin
+ while J < S'Last loop
+ pragma Loop_Variant (J); -- { dg-error "expect name \"Increases\"" }
+ pragma Loop_Variant (Increasing => J); -- { dg-error "expect name \"Increases\"" }
+ pragma Loop_Variant (J + 1); -- { dg-error "expect name \"Increases\"" }
+ pragma Loop_Variant (incr => -J + 1); -- { dg-error "expect name \"Increases\"" }
+ pragma Loop_Variant (decr => -J + 1); -- { dg-error "expect name \"Decreases\"" }
+ pragma Loop_Variant (foof => -J + 1); -- { dg-error "expect name \"Increases\" or \"Decreases\"" }
+ J := J + 2;
+ end loop;
+end Loopvar;