[Issue 22783] New: [dip1000] member function can pass pointer to member members to non-scope arg

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Feb 16 20:42:25 UTC 2022


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

          Issue ID: 22783
           Summary: [dip1000] member function can pass pointer to member
                    members to non-scope arg
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: Ajieskola at gmail.com

Compiled with -dip1000, latest master:
------
const(char)* charPtr;
// argument is not, or should not be scope
auto listUp(const(char)* content){registry = content;}

struct DontDoThis
{ char content;

  @safe escape()
  { // should not compile, but does.
    listUp(&content);
  }
}
------

--


More information about the Digitalmars-d-bugs mailing list