* don't print "parameter not used" hints for abstract methods (mantis #30431)

git-svn-id: trunk@34281 -
This commit is contained in:
Jonas Maebe 2016-08-12 13:35:34 +00:00
parent f4015f6ac9
commit c752050728
3 changed files with 26 additions and 1 deletions

1
.gitattributes vendored
View File

@ -15193,6 +15193,7 @@ tests/webtbs/tw30329.pp -text svneol=native#text/plain
tests/webtbs/tw30357.pp svneol=native#text/pascal
tests/webtbs/tw3038.pp svneol=native#text/plain
tests/webtbs/tw3041.pp svneol=native#text/plain
tests/webtbs/tw30431.pp svneol=native#text/plain
tests/webtbs/tw30443.pp svneol=native#text/plain
tests/webtbs/tw3045.pp svneol=native#text/plain
tests/webtbs/tw3048.pp svneol=native#text/plain

View File

@ -864,12 +864,14 @@ implementation
{ also don't claim for high param of open parameters (PM) }
{ also don't complain about unused symbols in generic procedures }
{ and methods }
{ and neither in abstract methods }
if (Errorcount<>0) or
([vo_is_hidden_para,vo_is_funcret] * tabstractvarsym(sym).varoptions = [vo_is_hidden_para]) or
(sp_internal in tsym(sym).symoptions) or
((assigned(tsym(sym).owner.defowner) and
(tsym(sym).owner.defowner.typ=procdef) and
(df_generic in tprocdef(tsym(sym).owner.defowner).defoptions))) then
((df_generic in tprocdef(tsym(sym).owner.defowner).defoptions) or
(po_abstractmethod in tprocdef(tsym(sym).owner.defowner).procoptions)))) then
exit;
if (tstoredsym(sym).refs=0) then
begin

22
tests/webtbs/tw30431.pp Normal file
View File

@ -0,0 +1,22 @@
{ %opt=-vh -Seh }
{ %norun }
program NotUsedParamInAbstractMethodBug;
{$mode objfpc}{$H+}
type
{ TXMLWriter }
TXMLWriter = class(TObject)
private
protected
procedure Write(const Buffer; Count: Longint); virtual; abstract;
public
end;
var
x: TXMLWriter;
begin
end.