Bug 14358 – [SDC] DMD should prevent declaring a function with a reserved name

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-03-28T16:43:25Z
Last change time
2024-12-13T18:41:29Z
Keywords
accepts-invalid
Assigned to
No Owner
Creator
Shammah Chancellor
Moved to GitHub: dmd#18962 →

Comments

Comment #0 by shammah.chancellor — 2015-03-28T16:43:25Z
SDC errors as follows: ``` ../bin/sdc test0134.d void __dtor() {} ^~~~~~ test0134.d:6: error: __dtor is a reserved name ``` DMD compiles incorrectly: ```test0134.d //T compiles:no //T has-passed:yes // Forbiden method name. struct Foo { void __dtor() {} } void main() {} ```
Comment #1 by ibuclaw — 2015-03-28T18:26:28Z
I suspect the same would be true for void __postblit() too.
Comment #2 by yebblies — 2015-04-11T06:26:08Z
AIUI this is working as intended, being reserved does not mean it has to generate an error when it's used.
Comment #3 by robert.schadek — 2024-12-13T18:41:29Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18962 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB