Browse Source

+ problem when passing a typecasted class instance to a var parameter
with -CR

git-svn-id: trunk@2741 -

Jonas Maebe 19 years ago
parent
commit
b910a5da10
2 changed files with 20 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 19 0
      tests/test/trangeob.pp

+ 1 - 0
.gitattributes

@@ -5710,6 +5710,7 @@ tests/test/trange2.pp svneol=native#text/plain
 tests/test/trange3.pp svneol=native#text/plain
 tests/test/trange4.pp svneol=native#text/plain
 tests/test/trange5.pp svneol=native#text/plain
+tests/test/trangeob.pp svneol=native#text/plain
 tests/test/tresstr.pp svneol=native#text/plain
 tests/test/trtti1.pp svneol=native#text/plain
 tests/test/trtti2.pp svneol=native#text/plain

+ 19 - 0
tests/test/trangeob.pp

@@ -0,0 +1,19 @@
+{ %opt=-CR -S2 }
+
+type
+  tc1 = class
+  end;
+
+  tc2 = class(tc1)
+  end;
+
+procedure t(var c: tc2);
+begin
+end;
+
+var
+  c: tc1;
+begin
+  c := tc2.create;
+  t(tc2(c));
+end.