Browse Source

Mantis #22792 was fixed by partial specializations addition in revision 27861

+ added test

git-svn-id: trunk@27900 -
svenbarth 11 years ago
parent
commit
60ef0a61bc
2 changed files with 35 additions and 0 deletions
  1. 1 0
      .gitattributes
  2. 34 0
      tests/webtbs/tw22792.pp

+ 1 - 0
.gitattributes

@@ -13795,6 +13795,7 @@ tests/webtbs/tw2277.pp svneol=native#text/plain
 tests/webtbs/tw22790a.pp svneol=native#text/pascal
 tests/webtbs/tw22790b.pp svneol=native#text/pascal
 tests/webtbs/tw22790c.pp svneol=native#text/pascal
+tests/webtbs/tw22792.pp svneol=native#text/pascal
 tests/webtbs/tw22796.pp svneol=native#text/plain
 tests/webtbs/tw2280.pp svneol=native#text/plain
 tests/webtbs/tw22860.pp svneol=native#text/plain

+ 34 - 0
tests/webtbs/tw22792.pp

@@ -0,0 +1,34 @@
+{ %NORUN }
+
+program tw22792;
+
+{$MODE DELPHI}
+
+type
+  TStaticArray<T> = array [0..MaxInt div SizeOf(T) - 1] of T;
+
+  TWrapper<TValue> = class
+  strict private
+    type
+      PValue = ^TValue;
+      PList = ^TList;
+      TList = TStaticArray<PValue>;
+        { Expand this manually to get rid of the error }
+  strict private
+    FList: PList;
+  public
+    procedure Z(const value: TValue);
+  end;
+
+procedure TWrapper<TValue>.Z(const value: TValue);
+begin
+  FList := GetMem(SizeOf(PValue));
+  FList^[0] := GetMem(SizeOf(TValue));
+  FList^[0]^ := value;
+    { Error: Illegal qualifier; use a manual cast to get rid of the error }
+  FreeMem(FList^[0]);
+  FreeMem(FList, SizeOf(PValue));
+end;
+
+begin
+end.