[Issue 21390] New: Cannot declare extern (storage class) variable of type with disabled default construction

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Nov 13 18:59:44 UTC 2020


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

          Issue ID: 21390
           Summary: Cannot declare extern (storage class) variable of type
                    with disabled default construction
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: n8sh.secondary at hotmail.com

Cannot have extern (storage class) variable of type with disabled default
construction.

---
struct S { @disable this(); }
// Does not compile: "default construction is disabled for type `S`"
extern __gshared S gVariable1;
// Does not compile: "extern symbols cannot have initializers"
extern __gshared S gVariable2 = S.init;
---

--


More information about the Digitalmars-d-bugs mailing list