mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-12-06 22:07:35 +01:00
fcl-passrc: useanalyzer: mark enumvalue parent types
git-svn-id: trunk@35865 -
This commit is contained in:
parent
db6e47a22c
commit
88600b71ef
@ -610,7 +610,12 @@ begin
|
||||
else if C.InheritsFrom(TPasExpr) then
|
||||
UseExpr(TPasExpr(El))
|
||||
else if C=TPasEnumValue then
|
||||
MarkElementAsUsed(El)
|
||||
begin
|
||||
repeat
|
||||
MarkElementAsUsed(El);
|
||||
El:=El.Parent;
|
||||
until not (El is TPasType);
|
||||
end
|
||||
else if C.InheritsFrom(TPasModule) then
|
||||
// e.g. unitname.identifier -> the module is used by the identifier
|
||||
else
|
||||
|
||||
@ -117,6 +117,7 @@ type
|
||||
procedure TestWP_PublishedRecordType;
|
||||
procedure TestWP_PublishedProcType;
|
||||
procedure TestWP_PublishedProperty;
|
||||
procedure TestWP_BuiltInFunctions;
|
||||
end;
|
||||
|
||||
implementation
|
||||
@ -1634,6 +1635,18 @@ begin
|
||||
AnalyzeWholeProgram;
|
||||
end;
|
||||
|
||||
procedure TTestUseAnalyzer.TestWP_BuiltInFunctions;
|
||||
begin
|
||||
StartProgram(false);
|
||||
Add([
|
||||
'type',
|
||||
' {#tordenum_used}TOrdEnum = (ordenum1,ordenum2);',
|
||||
'begin',
|
||||
' if ord(ordenum1)=1 then ;',
|
||||
'']);
|
||||
AnalyzeWholeProgram;
|
||||
end;
|
||||
|
||||
initialization
|
||||
RegisterTests([TTestUseAnalyzer]);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user