Bug 18823 – null is not shared as far as templates go

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-05-04T09:39:48Z
Last change time
2024-12-13T18:58:34Z
Assigned to
No Owner
Creator
Dmitry Olshansky
Moved to GitHub: dmd#19430 →

Comments

Comment #0 by dmitry.olsh — 2018-05-04T09:39:48Z
Tested on DMD 2.079. void main(){ // failure: template testme.takePointer cannot deduce function from argument types //!()(typeof(null)), candidates are: ... takePointer(null); takePointer2(null); } void takePointer(T)(shared(T)* ptr){} void takePointer2(T)(shared T* ptr){} // same problem in the "real" world void inPhobos(){ import core.atomic; shared Object abc; shared Object b = new Object; cas(&abc, b, null); // doesn't compile cas(&abc, b, cast(shared)null); // this compiles atomicStore(abc, null); // this compiles as well }
Comment #1 by turkeyman — 2019-08-20T07:34:40Z
https://github.com/dlang/druntime/pull/2745 Fixes the issue in core.atomic, but the actual issue certainly remains...
Comment #2 by robert.schadek — 2024-12-13T18:58:34Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19430 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB