www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 19396] New: [betterC] ScopeBuffer can't be used with betterC


          Issue ID: 19396
           Summary: [betterC] ScopeBuffer can't be used with betterC with
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: radu.racariu gmail.com

std.internal.scopebuffer is a nice utility that can be used when developing for

The following
import std.internal.scopebuffer;
void main()
        ScopeBuffer!char buf;

void onOutOfMemoryError(void* pretend_sideffect = null)  trusted pure nothrow
    assert(false, "Out of memory.");
Compiled with `-betterC -release  -O -inline` will error out:
/dlang/dmd/linux/bin64/../../src/druntime/import/core/exception.d(540): Error:
Cannot use throw statements with -betterC

Removing `-inline` makes the error go away.

Nov 13 2018