diff options
author | Ed Schonberg <schonberg@adacore.com> | 2018-05-22 13:22:06 +0000 |
---|---|---|
committer | Pierre-Marie de Rodat <pmderodat@gcc.gnu.org> | 2018-05-22 13:22:06 +0000 |
commit | 531351e8f4b0290e252009d5667498db4570a3fb (patch) | |
tree | b116a8ba57d29820fdb42e15e75e5fd55097d251 /gcc/ada/atree.h | |
parent | 9c629d61f03d15608ed6b7d3250dbba5f72293eb (diff) | |
download | gcc-531351e8f4b0290e252009d5667498db4570a3fb.zip gcc-531351e8f4b0290e252009d5667498db4570a3fb.tar.gz gcc-531351e8f4b0290e252009d5667498db4570a3fb.tar.bz2 |
[Ada] Crash on pragma Compile_Time_Warning with declared string constant
This patch fixes a compiler abort on a pragma Compile_Time_Warning when its
second argument is a reference to a constsant string (rather than a string
literal or an expression that evaluates to a string literal).
Compiling msain.adb must yield:
main.adb:5:33: warning: Good
main.adb:6:33: warning: VALLUE
main.adb:7:33: warning: Test
----
procedure Main is
Value : constant String := "Test";
Switch : constant Boolean := True;
begin
pragma Compile_Time_Warning (Switch, "Good");
pragma Compile_Time_Warning (Switch, "VAL" & "LUE");
pragma Compile_Time_Warning (Switch, value);
null;
end Main;
2018-05-22 Ed Schonberg <schonberg@adacore.com>
gcc/ada/
* sem_prag.adb (Process_Compile_Time_Warning_Or_Error): Handle properly
a second argument that is a constant of a given string value.
From-SVN: r260514
Diffstat (limited to 'gcc/ada/atree.h')
0 files changed, 0 insertions, 0 deletions