[Issue 18493] New: [betterC] Can't use aggregated type with postblit

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Feb 22 12:56:55 UTC 2018


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

          Issue ID: 18493
           Summary: [betterC] Can't use aggregated type with postblit
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: radu.racariu at gmail.com

The following compiled with '-betterC':

=====================================
@nogc
nothrow:

struct S
{
    @nogc
    nothrow:

    this(this)
    {
        impl++;
    }

    ~this()
    {
    }

    int* impl;   
}

struct C
{
    S s1;
    S s2;
}

extern(C) int main()
{
    return 0;
}
=====================================

Produces a meaningless error (no line number no file name):

`Error: Cannot use try-catch statements with -betterC`

Commenting either the postblit ctor or dtor makes the error go away.

Expected:
To get no error.

--


More information about the Digitalmars-d-bugs mailing list