Commit e3371908 by Eric Botcazou Committed by Eric Botcazou

trans.c (Pragma_to_gnu): Push a diagnostics state for pragma Warnings (Off)…

trans.c (Pragma_to_gnu): Push a diagnostics state for pragma Warnings (Off) before turning off all the...

	* 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).

From-SVN: r279519
parent d4a45898
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
......
......@@ -1975,7 +1975,21 @@ Pragma_to_gnu (Node_Id gnat_node)
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
......
-- { 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment