diff --git a/.gitattributes b/.gitattributes index 8ff3f1cade..2cb0d46089 100644 --- a/.gitattributes +++ b/.gitattributes @@ -10954,6 +10954,7 @@ tests/webtbs/tw18334.pp svneol=native#text/plain tests/webtbs/tw18443.pp svneol=native#text/pascal tests/webtbs/tw1850.pp svneol=native#text/plain tests/webtbs/tw1851.pp svneol=native#text/plain +tests/webtbs/tw18512.pp svneol=native#text/pascal tests/webtbs/tw1856.pp svneol=native#text/plain tests/webtbs/tw1862.pp svneol=native#text/plain tests/webtbs/tw1863.pp svneol=native#text/plain diff --git a/compiler/pexpr.pas b/compiler/pexpr.pas index 8dadb83480..13bf5a3397 100644 --- a/compiler/pexpr.pas +++ b/compiler/pexpr.pas @@ -535,8 +535,6 @@ implementation in_args:=true; p1:=comp_expr(true,false); p1:=caddrnode.create(p1); - if cs_typed_addresses in current_settings.localswitches then - include(p1.flags,nf_typedaddr); consume(_RKLAMMER); statement_syssym:=p1; end; diff --git a/tests/webtbs/tw0882.pp b/tests/webtbs/tw0882.pp index 0f1f80a585..15e001f921 100644 --- a/tests/webtbs/tw0882.pp +++ b/tests/webtbs/tw0882.pp @@ -18,7 +18,8 @@ BEGIN bb0^[0] := 1; bb0^[1] := 2; {$T+} - bw:=word(Addr(bb0^[mr.i1])^); + // Addr return untyped pointer, @ typed + bw:=word((@bb0^[mr.i1])^); if bw <> 1 then halt(1); {$T-} diff --git a/tests/webtbs/tw18512.pp b/tests/webtbs/tw18512.pp new file mode 100644 index 0000000000..bbc3865c77 --- /dev/null +++ b/tests/webtbs/tw18512.pp @@ -0,0 +1,10 @@ +{ %norun } +program tw18152; +{$TypedAddress on} +var + p: ^integer; + c: char; +begin + // test that addr return untyped pointer inspite of $TypedAddress directive + p := addr(c) +end. \ No newline at end of file