[Issue 9744] New: shared and __gshared variables can have their address taken at compile time

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Mar 18 02:58:10 PDT 2013


http://d.puremagic.com/issues/show_bug.cgi?id=9744

           Summary: shared and __gshared variables can have their address
                    taken at compile time
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: clugdbug at yahoo.com.au


--- Comment #0 from Don <clugdbug at yahoo.com.au> 2013-03-18 02:58:09 PDT ---
Taking the address of a static variable is rejected, but not a __gshared
variable:

---
__gshared int x1;
static int x2;
static void *q1 = &x1;    // Compiles
static void *q2 = &x2;    // Rejected
---

bug.d(4): Error: non-constant expression & x2


This doesn't apply in CTFE, only in constant folding.

There is a unittest in bitmanip which relies on this bug.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list