ソースを参照

fpc: allow hint directives between other procedure directives in Delphi mode (issue #25101)

git-svn-id: trunk@25710 -
paul 11 年 前
コミット
912384594b
3 ファイル変更19 行追加1 行削除
  1. 1 0
      .gitattributes
  2. 4 1
      compiler/pdecsub.pas
  3. 14 0
      tests/webtbs/tw25101.pp

+ 1 - 0
.gitattributes

@@ -13607,6 +13607,7 @@ tests/webtbs/tw25054b.pp svneol=native#text/pascal
 tests/webtbs/tw25059.pp svneol=native#text/pascal
 tests/webtbs/tw25077.pp svneol=native#text/pascal
 tests/webtbs/tw25081.pp svneol=native#text/pascal
+tests/webtbs/tw25101.pp svneol=native#text/pascal
 tests/webtbs/tw2514.pp svneol=native#text/plain
 tests/webtbs/tw2525.pp svneol=native#text/plain
 tests/webtbs/tw2536.pp svneol=native#text/plain

+ 4 - 1
compiler/pdecsub.pas

@@ -2483,7 +2483,10 @@ const
              _UNIMPLEMENTED,
              _EXPERIMENTAL,
              _DEPRECATED :
-               exit;
+               if (pd.typ=procdef) and (m_delphi in current_settings.modeswitches) then
+                 maybe_parse_hint_directives(tprocdef(pd))
+               else
+                 exit;
            end;
          end;
 

+ 14 - 0
tests/webtbs/tw25101.pp

@@ -0,0 +1,14 @@
+program tw25101.pp;
+
+{$IFDEF FPC}
+  {$MODE DELPHI}
+{$ENDIF}
+
+type
+  TTest = class(TObject)
+  public
+    procedure Test(); virtual; deprecated 'Do not use this method'; abstract;
+  end;
+
+begin
+end.