www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 18493] New: [betterC] Can't use aggregated type with postblit

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 puremagic.com
          Reporter: radu.racariu 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.

--
Feb 22 2018