www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 22265] New: importC: Error: cannot modify 'const' expression

https://issues.dlang.org/show_bug.cgi?id=22265

          Issue ID: 22265
           Summary: importC: Error: cannot modify 'const' expression
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: major
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: ibuclaw gdcproject.org

It looks like 'const char*' is being translated to 'const(char*)' instead of
'const(char)*'.

Reduced test:
---
void test(const char *buf)
{
  int a = *buf++;
}

--
Sep 01