mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 13:49:39 +02:00
* have pointerdefs and classrefdefs "inherit" the df_generic and df_specialization flags from the def they point to and set the genericdef accordingly
git-svn-id: trunk@35091 -
This commit is contained in:
parent
7ead78e71b
commit
f8c23c84b6
@ -169,6 +169,21 @@ implementation
|
|||||||
srsym:=tstoreddef(tmp).typesym;
|
srsym:=tstoreddef(tmp).typesym;
|
||||||
end;
|
end;
|
||||||
tabstractpointerdef(def).pointeddef:=ttypesym(srsym).typedef;
|
tabstractpointerdef(def).pointeddef:=ttypesym(srsym).typedef;
|
||||||
|
{ correctly set the generic/specialization flags and the genericdef }
|
||||||
|
if df_generic in tstoreddef(tabstractpointerdef(def).pointeddef).defoptions then
|
||||||
|
include(tstoreddef(def).defoptions,df_generic);
|
||||||
|
if df_specialization in tstoreddef(tabstractpointerdef(def).pointeddef).defoptions then
|
||||||
|
begin
|
||||||
|
include(tstoreddef(def).defoptions,df_specialization);
|
||||||
|
case def.typ of
|
||||||
|
pointerdef:
|
||||||
|
tstoreddef(def).genericdef:=cpointerdef.getreusable(tstoreddef(tabstractpointerdef(def).pointeddef).genericdef);
|
||||||
|
classrefdef:
|
||||||
|
tstoreddef(def).genericdef:=cclassrefdef.create(tstoreddef(tabstractpointerdef(def).pointeddef).genericdef);
|
||||||
|
else
|
||||||
|
internalerror(2016120901);
|
||||||
|
end;
|
||||||
|
end;
|
||||||
{ avoid wrong unused warnings web bug 801 PM }
|
{ avoid wrong unused warnings web bug 801 PM }
|
||||||
inc(ttypesym(srsym).refs);
|
inc(ttypesym(srsym).refs);
|
||||||
{ we need a class type for classrefdef }
|
{ we need a class type for classrefdef }
|
||||||
|
@ -3243,6 +3243,10 @@ implementation
|
|||||||
begin
|
begin
|
||||||
inherited create(dt,true);
|
inherited create(dt,true);
|
||||||
pointeddef:=def;
|
pointeddef:=def;
|
||||||
|
if df_generic in pointeddef.defoptions then
|
||||||
|
include(defoptions,df_generic);
|
||||||
|
if df_specialization in pointeddef.defoptions then
|
||||||
|
include(defoptions,df_specialization);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -3294,6 +3298,8 @@ implementation
|
|||||||
begin
|
begin
|
||||||
inherited create(pointerdef,def);
|
inherited create(pointerdef,def);
|
||||||
has_pointer_math:=cs_pointermath in current_settings.localswitches;
|
has_pointer_math:=cs_pointermath in current_settings.localswitches;
|
||||||
|
if df_specialization in tstoreddef(def).defoptions then
|
||||||
|
genericdef:=cpointerdef.getreusable(tstoreddef(def).genericdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -3421,6 +3427,8 @@ implementation
|
|||||||
constructor tclassrefdef.create(def:tdef);
|
constructor tclassrefdef.create(def:tdef);
|
||||||
begin
|
begin
|
||||||
inherited create(classrefdef,def);
|
inherited create(classrefdef,def);
|
||||||
|
if df_specialization in tstoreddef(def).defoptions then
|
||||||
|
genericdef:=cclassrefdef.create(tstoreddef(def).genericdef);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user