mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-13 06:29:32 +02:00
* handle generic with ord call of sub-range and enumeration data excluding 0 correctly, resolves #38412
git-svn-id: trunk@48452 -
This commit is contained in:
parent
e99827246e
commit
4bec57702f
1
.gitattributes
vendored
1
.gitattributes
vendored
@ -18649,6 +18649,7 @@ tests/webtbs/tw38385.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw38390.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3840.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3841.pp svneol=native#text/plain
|
||||
tests/webtbs/tw38412.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw38413.pp svneol=native#text/pascal
|
||||
tests/webtbs/tw3863.pp svneol=native#text/plain
|
||||
tests/webtbs/tw3864.pp svneol=native#text/plain
|
||||
|
@ -655,7 +655,7 @@ implementation
|
||||
resultdef:=typedef;
|
||||
{ only do range checking when explicitly asked for it
|
||||
and if the type can be range checked, see tests/tbs/tb0539.pp }
|
||||
if (resultdef.typ in [orddef,enumdef]) then
|
||||
if (resultdef.typ in [orddef,enumdef]) and not(nf_generic_para in flags) then
|
||||
adaptrange(resultdef,value,nf_internal in flags,not rangecheck,rangecheck)
|
||||
end;
|
||||
|
||||
|
10
tests/webtbs/tw38412.pp
Normal file
10
tests/webtbs/tw38412.pp
Normal file
@ -0,0 +1,10 @@
|
||||
{ %norun }
|
||||
type
|
||||
measure = (short := 1, long := 2);
|
||||
generic bar<const x: measure> = object
|
||||
public
|
||||
const
|
||||
myMeasure = ord(x);
|
||||
end;
|
||||
begin
|
||||
end.
|
Loading…
Reference in New Issue
Block a user