www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19953] New: extern(C++) const ref to static array incorrectly

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

          Issue ID: 19953
           Summary: extern(C++) const ref to static array incorrectly adds
                    const to the mangle name
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: iamthewilsonator hotmail.com

short test27(int (& const arr)[6][291]) { return 0;};

with MSVC gives warning C4227: anachronism used: qualifiers on reference are
ignored

and hence mangles as 

?test27  YAFAE_A_Y15BCD H Z (without the underscores, A being mutable)

whereas DMD mangles

extern(C++) short test27(const ref int[291][6] t);

 as 

?test27  YAFAE_B_Y15BCD H Z (without the underscores, B being const).

--
Jun 11 2019