Bug 20123 – Impossible to disable post-increment/decrement semantics

Status
NEW
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2019-08-12T03:18:36Z
Last change time
2024-12-13T19:04:50Z
Keywords
pull
Assigned to
No Owner
Creator
Manu
Moved to GitHub: dmd#19606 →

Comments

Comment #0 by turkeyman — 2019-08-12T03:18:36Z
D implements post-increment/decrement with a lowered expression. According to the docs; (auto t = val, ++val, t) I'm implementing C++'s atomic<T> type, which implements `operator++` & `operator--`, but I realised that the lowering is not atomic, and I seem to have no way to implement the post-inc/dec operators explicitly such that I can make them atomic. To properly implement this library, I need a way to implement the post-int/dec operators explicitly.
Comment #1 by turkeyman — 2019-08-12T03:19:25Z
Or a way to @disable the post-inc/dec semantics explicitly, so that I can implement pre-inc/dec without opening the door for a race on the lowering.
Comment #2 by dlang-bot — 2021-03-24T05:42:32Z
@thewilsonator updated dlang/dmd pull request #12301 "Fix issue20123 by allowing opUnaryRight to disable post-[inc|dec]rement" fixing this issue: - Fix issue 20123 by allowing opUnaryRight to disable post-[inc|dec]rement https://github.com/dlang/dmd/pull/12301
Comment #3 by robert.schadek — 2024-12-13T19:04:50Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19606 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB