www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21390] New: Cannot declare extern (storage class) variable of

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 puremagic.com
          Reporter: n8sh.secondary 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;
---

--
Nov 13 2020