+2019-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gcc-interface/trans.c (Pragma_to_gnu) <Pragma_Warnings>: Push a
+ diagnostics state for pragma Warnings (Off) before turning off all
+ the warnings and only pop it for pragma Warnings (On).
+
2019-12-18 Justin Squirek <squirek@adacore.com>
* sem_ch6.adb (Analyze_Function_Return): Modify handling of
gnat_expr = Expression (Next (gnat_temp));
}
else
- gnat_expr = Empty;
+ {
+ gnat_expr = Empty;
+
+ /* For pragma Warnings (Off), we save the current state... */
+ if (kind == DK_IGNORED)
+ diagnostic_push_diagnostics (global_dc, location);
+
+ /* ...so that, for pragma Warnings (On), we do not enable all
+ the warnings but just restore the previous state. */
+ else
+ {
+ diagnostic_pop_diagnostics (global_dc, location);
+ break;
+ }
+ }
imply = false;
}
+2019-12-18 Eric Botcazou <ebotcazou@adacore.com>
+
+ * gnat.dg/warn32.adb: New test.
+
2019-12-17 Martin Sebor <msebor@redhat.com>
PR c++/61339
--- /dev/null
+-- { dg-do compile }
+-- { dg-options "-O -gnatn -Winline -cargs --param max-inline-insns-single=50 -margs" }
+
+with Ada.Containers.Vectors;
+with Ada.Strings.Unbounded; use Ada.Strings.Unbounded;
+with Ada.Text_IO;
+
+procedure Warn32 is
+ type Selected_Block_T is record
+ Contents : Unbounded_String;
+ File_Name : Unbounded_String;
+ end record;
+
+ pragma Warnings (Off, "-Winline");
+ package Selected_Block_List is
+ new Ada.Containers.Vectors (Natural, Selected_Block_T);
+begin
+ Ada.Text_Io.Put_Line ("Hello World!");
+end;