mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-16 05:09:17 +02:00
* mark constant symbols used in preprocessor expressions as used, resolves #40108
This commit is contained in:
parent
84e7a17b67
commit
8ef0f59025
@ -2134,11 +2134,13 @@ type
|
|||||||
begin
|
begin
|
||||||
result.free;
|
result.free;
|
||||||
result:=texprvalue.create_const(tconstsym(srsym));
|
result:=texprvalue.create_const(tconstsym(srsym));
|
||||||
|
tconstsym(srsym).IncRefCount;
|
||||||
end;
|
end;
|
||||||
enumsym:
|
enumsym:
|
||||||
begin
|
begin
|
||||||
result.free;
|
result.free;
|
||||||
result:=texprvalue.create_int(tenumsym(srsym).value);
|
result:=texprvalue.create_int(tenumsym(srsym).value);
|
||||||
|
// tconstsym(srsym).IncRefCount;
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
;
|
;
|
||||||
|
14
tests/webtbs/tw40108.pp
Normal file
14
tests/webtbs/tw40108.pp
Normal 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.
|
Loading…
Reference in New Issue
Block a user