www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12147] New: Any bitfield with member named "version" will fail to compile

reply d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12147

           Summary: Any bitfield with member named "version" will fail to
                    compile
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: bdsatish yahoo.in


--- Comment #0 from bdsatish yahoo.in 2014-02-12 17:00:23 PST ---
If the member of any bitfield is named "version", then the compilation fails.

Example:


    import std.bitmanip;


    struct S {
       mixin(bitfields!(uint, "version", 8));
    }


Compilation error:
/d944/f401.d(5): Error: no identifier for declarator uint 
/d944/f401.d(5): Error: semicolon expected, not 'version'
/d944/f401.d(5): Error: identifier or integer expected, not )
/d944/f401.d(5): Error: found 'pure' when expecting ')'
/d944/f401.d(5): Error: Declaration expected, not 'return'
/d944/f401.d(6): Error: no identifier for declarator void
/d944/f401.d(6): Error: semicolon expected, not 'version'

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 12 2014
parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12147


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |thecybershadow gmail.com
         Resolution|                            |INVALID


--- Comment #1 from Vladimir Panteleev <thecybershadow gmail.com> 2014-02-13
05:16:48 EET ---
"version" is a reserved keyword in D. Since std.bitmanip will declare
properties for each bitfield, they must be valid D identifiers, and thus cannot
be reserved keywords.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 12 2014