* mark constant symbols used in preprocessor expressions as used, resolves #40108

This commit is contained in:
florian 2023-01-24 22:36:26 +01:00
parent 84e7a17b67
commit 8ef0f59025
2 changed files with 16 additions and 0 deletions

View File

@ -2134,11 +2134,13 @@ type
begin
result.free;
result:=texprvalue.create_const(tconstsym(srsym));
tconstsym(srsym).IncRefCount;
end;
enumsym:
begin
result.free;
result:=texprvalue.create_int(tenumsym(srsym).value);
// tconstsym(srsym).IncRefCount;
end;
else
;

14
tests/webtbs/tw40108.pp Normal file
View File

@ -0,0 +1,14 @@
{ %opt=-Seh }
{ %norun }
program test;
const
TheVersion = 1;
begin
{$if TheVersion >= 1}
writeln('Version 1 or higher');
{$else}
writeln('Version < 1');
{$endif}
end.