Bug 8347 – Parser bug with const placed after ~this() in decl

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-07-04T02:28:00Z
Last change time
2013-05-08T17:31:04Z
Keywords
pull
Assigned to
nobody
Creator
dmitry.olsh

Comments

Comment #0 by dmitry.olsh — 2012-07-04T02:28:45Z
A small test shows parser inconsistency: struct A{ //const this(int dummy){} //fine this(int dummy) const {} //and this too ~this() const{} //NG //const ~this(){} //this work } void main(){} Output: m1.d(4): Error: semicolon expected following function declaration Note that const in front of ~this works but not after unlike any other member function/constructor. Tested with latest git master for 2.060, must have been in previous versions as well.
Comment #1 by henning — 2013-05-08T11:21:34Z
Comment #2 by github-bugzilla — 2013-05-08T17:28:57Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a959f220ce7d6191d2247b5355acb9755fbe8e36 Merge pull request #1979 from hpohl/9401 fix issues 8347, 8953 and 9401 - destructor and nothrow syntax