Thread overview
[Issue 20634] @safe forces bounds checking on newly allocated array when using .ptr
Dec 17, 2022
Iain Buclaw
Jul 05, 2023
Nick Treleaven
Sep 06, 2023
Dlang Bot
Sep 13, 2023
Dlang Bot
Sep 13, 2023
Nick Treleaven
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20634

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P4

--
July 05, 2023
https://issues.dlang.org/show_bug.cgi?id=20634

Nick Treleaven <nick@geany.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nick@geany.org

--- Comment #1 from Nick Treleaven <nick@geany.org> ---
The reason for this error is to prevent `[42][1..1].ptr`, which is not @safe. Your example could be allowed if the literal has not been sliced.

--
September 06, 2023
https://issues.dlang.org/show_bug.cgi?id=20634

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ntrel created dlang/dmd pull request #15581 "Allow using .ptr in @safe code when pointer is safe to dereference" fixing this issue:

- Fix Issue 20634 - @safe forces bounds checking on newly allocated array when using .ptr

  Also allow for any string literal.

https://github.com/dlang/dmd/pull/15581

--
September 13, 2023
https://issues.dlang.org/show_bug.cgi?id=20634

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
@ntrel updated dlang/dmd pull request #15572 "Fix Issue 24135 - Eponymous template member overloads not shown as call candidates" fixing this issue:

- Fix Issue 20634 - @safe forces bounds checking on newly allocated array when using .ptr

  Also allow for any string literal.

https://github.com/dlang/dmd/pull/15572

--
September 13, 2023
https://issues.dlang.org/show_bug.cgi?id=20634

--- Comment #4 from Nick Treleaven <nick@geany.org> ---
Note: The second commit was wrongly included in that pull and has been removed.

--