www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11768] New: inconsistent behavior of type qualifier inout + const

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

           Summary: inconsistent behavior of type qualifier inout + const
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: wrong-code
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: k.hara.pg gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg gmail.com> 2013-12-18 20:00:45 PST ---
Currently inout(const(T)) should become const(T).

Test case:

void test1(inout int = 0)
{
    const(inout(char)) k1;
    inout(const(char)) k2;
    static assert(typeof(k1).stringof == "const(char)");    // OK
    static assert(typeof(k2).stringof == "const(char)");    // fails
    static assert(is(typeof(k1) == typeof(k2)));            // fails
}

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 18 2013
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11768


Kenji Hara <k.hara.pg gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kenji Hara <k.hara.pg gmail.com> 2013-12-18 20:16:17 PST ---
https://github.com/D-Programming-Language/dmd/pull/2987

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 18 2013
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=11768



--- Comment #2 from github-bugzilla puremagic.com 2013-12-21 12:56:11 PST ---
Commit pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/09448ff6c3d1a273444983cf94f9b07ff70d112d
fix Issue 11768 - inconsistent behavior of type qualifier inout + const

Fix up `Parser::parseBasicType` by using `Type::addSTC`

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 21 2013