www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 23169] New: [DIP1000] Mangling does not distinguish return

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

          Issue ID: 23169
           Summary: [DIP1000] Mangling does not distinguish return and
                    return scope
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: Ajieskola gmail.com

Tested with dmd 2.100.0

------------------
struct Ptr
{ int* impl;
  void* fun1() return scope {return impl;}
  void* fun2() return {return &this;}
}

void main()
{ import std.demangle, std.stdio;
  Ptr.fun1.mangleof.writeln;
  Ptr.fun2.mangleof.writeln;
}
------------------

This outputs two similar mangled names except for the function name. They
should be mangled differently since the this reference has a different storage
class between the two.

--
Jun 07 2022