* don't allow multiple deprecated messages, resolves #21466

git-svn-id: trunk@20515 -
This commit is contained in:
florian 2012-03-12 21:39:43 +00:00
parent e9c5458dd2
commit fbc519faeb
3 changed files with 16 additions and 0 deletions

1
.gitattributes vendored
View File

@ -11320,6 +11320,7 @@ tests/webtbf/tw21078.pp svneol=native#text/plain
tests/webtbf/tw21087.pp svneol=native#text/plain
tests/webtbf/tw2128.pp svneol=native#text/plain
tests/webtbf/tw2129.pp svneol=native#text/plain
tests/webtbf/tw21466.pas svneol=native#text/pascal
tests/webtbf/tw2154.pp svneol=native#text/plain
tests/webtbf/tw2174.pp svneol=native#text/plain
tests/webtbf/tw2209.pp svneol=native#text/plain

View File

@ -1015,9 +1015,11 @@ implementation
function try_consume_hintdirective(var moduleopt:tmoduleoptions; var deprecatedmsg:pshortstring):boolean;
var
deprecated_seen,
last_is_deprecated:boolean;
begin
try_consume_hintdirective:=false;
deprecated_seen:=false;
repeat
last_is_deprecated:=false;
case idtoken of
@ -1028,9 +1030,13 @@ implementation
end;
_DEPRECATED :
begin
{ allow deprecated only once }
if deprecated_seen then
break;
include(moduleopt,mo_hint_deprecated);
try_consume_hintdirective:=true;
last_is_deprecated:=true;
deprecated_seen:=true;
end;
_EXPERIMENTAL :
begin

9
tests/webtbf/tw21466.pas Normal file
View File

@ -0,0 +1,9 @@
{ %fail }
unit tw21466 deprecated 'blah blah' deprecated 'koko';
interface
implementation
finalization
end.