www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 14878] New: destructor of lambda parameter not included in


          Issue ID: 14878
           Summary: destructor of lambda parameter not included in
                    speculative  safe check
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

cat > bug.d << CODE
struct T
    ~this()  system {}

static assert(!__traits(compiles, (T)  safe {}));
static assert(!is(typeof((T)  safe {})));


This is an idiom that emerged from working on dup [¹] to quickly check whether
a struct has a  safe dtor or postblit.

The postblit check `__traits(compiles, (T b) { T a = b;})` works fine.


Aug 06 2015