mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-20 11:09:42 +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;
|
||||
end;
|
||||
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 }
|
||||
inc(ttypesym(srsym).refs);
|
||||
{ we need a class type for classrefdef }
|
||||
|
@ -3243,6 +3243,10 @@ implementation
|
||||
begin
|
||||
inherited create(dt,true);
|
||||
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;
|
||||
|
||||
|
||||
@ -3294,6 +3298,8 @@ implementation
|
||||
begin
|
||||
inherited create(pointerdef,def);
|
||||
has_pointer_math:=cs_pointermath in current_settings.localswitches;
|
||||
if df_specialization in tstoreddef(def).defoptions then
|
||||
genericdef:=cpointerdef.getreusable(tstoreddef(def).genericdef);
|
||||
end;
|
||||
|
||||
|
||||
@ -3421,6 +3427,8 @@ implementation
|
||||
constructor tclassrefdef.create(def:tdef);
|
||||
begin
|
||||
inherited create(classrefdef,def);
|
||||
if df_specialization in tstoreddef(def).defoptions then
|
||||
genericdef:=cclassrefdef.create(tstoreddef(def).genericdef);
|
||||
end;
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user