瀏覽代碼

* fixed issue with static fields

git-svn-id: trunk@1803 -
florian 19 年之前
父節點
當前提交
aa22e57a7e
共有 4 個文件被更改,包括 41 次插入3 次删除
  1. 2 0
      .gitattributes
  2. 0 3
      compiler/pdecvar.pas
  3. 19 0
      tests/webtbf/tw4529.pp
  4. 20 0
      tests/webtbs/tw4529.pp

+ 2 - 0
.gitattributes

@@ -5670,6 +5670,7 @@ tests/webtbf/tw4244.pp svneol=native#text/plain
 tests/webtbf/tw4256.pp svneol=native#text/plain
 tests/webtbf/tw4359.pp svneol=native#text/plain
 tests/webtbf/tw4445.pp svneol=native#text/plain
+tests/webtbf/tw4529.pp svneol=native#text/plain
 tests/webtbf/uw0744.pp svneol=native#text/plain
 tests/webtbf/uw0840a.pp svneol=native#text/plain
 tests/webtbf/uw0840b.pp svneol=native#text/plain
@@ -6372,6 +6373,7 @@ tests/webtbs/tw4477.pp svneol=native#text/plain
 tests/webtbs/tw4487.pp -text svneol=unset#text/plain
 tests/webtbs/tw4489.pp -text svneol=unset#text/plain
 tests/webtbs/tw4496.pp svneol=native#text/plain
+tests/webtbs/tw4529.pp -text svneol=unset#text/plain
 tests/webtbs/tw4537.pp svneol=native#text/plain
 tests/webtbs/ub1873.pp svneol=native#text/plain
 tests/webtbs/ub1883.pp svneol=native#text/plain

+ 0 - 3
compiler/pdecvar.pas

@@ -1150,11 +1150,8 @@ implementation
                (cs_static_keyword in aktmoduleswitches) and (idtoken=_STATIC) then
                   begin
                     include(current_object_option,sp_static);
-                    insert_syms(sc,tt,false,dummysymoptions);
-                    exclude(current_object_option,sp_static);
                     consume(_STATIC);
                     consume(_SEMICOLON);
-                    symdone:=true;
                   end;
 
              { insert it in the symtable, if not done yet }

+ 19 - 0
tests/webtbf/tw4529.pp

@@ -0,0 +1,19 @@
+{ %FAIL }
+{ Source provided for Free Pascal Bug Report 4529 }
+{ Submitted by "Vincent Snijders" on  2005-11-20 }
+{ e-mail: [email protected] }
+program Project1;
+
+{$mode objfpc}{$H+}{$static on}
+
+uses
+  Classes
+  { add your units here };
+
+type
+  MyClass = class(TComponent)
+    FClassVar: integer; static;
+  end;
+
+begin
+end.

+ 20 - 0
tests/webtbs/tw4529.pp

@@ -0,0 +1,20 @@
+{ Source provided for Free Pascal Bug Report 4529 }
+{ Submitted by "Vincent Snijders" on  2005-11-20 }
+{ e-mail: [email protected] }
+program Project1;
+
+{$mode objfpc}{$H+}{$static on}
+
+uses
+  Classes
+  { add your units here };
+
+type
+  MyClass = class(TComponent)
+  //private
+  public
+    FClassVar: integer; static;
+  end;
+
+begin
+end.