[Issue 18979] New: Template constructor bypasses private

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Jun 13 23:09:44 UTC 2018


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

          Issue ID: 18979
           Summary: Template constructor bypasses private
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: atila.neves at gmail.com

The following compiles but shouldn't:

foo.d:
struct Foo {
    private this(A)(A arg) { }
}

bar.d:
import foo;
void func() {
    auto f = Foo(42);
}

--


More information about the Digitalmars-d-bugs mailing list