Browse Source

fcl-passrc: useanalyzer: do not export resourcestrings

mattias 5 years ago
parent
commit
598d4e8ba7

+ 4 - 1
compiler/packages/fcl-passrc/src/pasuseanalyzer.pas

@@ -1282,7 +1282,10 @@ begin
       UseVariable(TPasVariable(Decl),rraNone,true);
       end
     else if C=TPasResString then
-      UseResourcestring(TPasResString(Decl))
+      begin
+      if OnlyExports then continue;
+      UseResourcestring(TPasResString(Decl));
+      end
     else
       RaiseNotSupported(20170306165213,Decl);
     end;

+ 1 - 1
compiler/packages/fcl-passrc/tests/tcuseanalyzer.pas

@@ -836,9 +836,9 @@ begin
   StartProgram(false);
   Add([
   'resourcestring',
-  'resourcestring',
   '  {#a_used}a = ''txt'';',
   '  {#b_used}b = ''foo'';',
+  '  {#c_notused}c = ''bar'';',
   'procedure {#DoIt_used}DoIt(s: string);',
   'var',
   '  {#d_used}d: string;',