https://issues.dlang.org/show_bug.cgi?id=18172
--- Comment #4 from Jack Stouffer <j...@jackstouffer.com> --- (In reply to Jonathan M Davis from comment #3) > I'd suggest looking into how DIP 1000 can fix this problem without needing > ref, since with DIP 1000, taking the address of a local variable isn't > necessarily @system. Despite marking the parameters as scope and using `@safe` to check for any security holes, creating a scoped pointer still yields an error ===== @safe unittest { auto args = ["prog", "--foo", "-b"]; bool foo; bool bar; scope bool* f = &foo; scope bool* b = &bar; auto rslt = getopt(args, "foo|f", "Some information about foo.", f, "bar|b", "Some help message about bar.", b); } ===== std/getopt.d(452): Error: cannot take address of local foo in @safe function __unittest_L446_C7 std/getopt.d(453): Error: cannot take address of local bar in @safe function __unittest_L446_C7 --