www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15505] New: cxtern(C++) array parameter mangling gains


          Issue ID: 15505
           Summary: cxtern(C++) array parameter mangling gains surprise
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: turkeyman gmail.com

extern(C++) void f(int[4]* t);
Mangles as: void __cdecl f(int (* const)[4])

Where did that const come from?

This would logically be connected to a C++ function declared:
  void f(int(*x)[4]);
Which mangles: void __cdecl f(int (*)[4])

I think it very unlikely that any C++ user would have functions:
  void f(int(*const x)[4]);

Nobody uses *const in C++.

Jan 03 2016