[Issue 19396] New: [betterC] ScopeBuffer can't be used with betterC with inline
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Nov 13 12:02:53 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=19396
Issue ID: 19396
Summary: [betterC] ScopeBuffer can't be used with betterC with
inline
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: enhancement
Priority: P1
Component: phobos
Assignee: nobody at puremagic.com
Reporter: radu.racariu at gmail.com
std.internal.scopebuffer is a nice utility that can be used when developing for
betterC.
The following
```
import std.internal.scopebuffer;
extern(C):
void main()
{
ScopeBuffer!char buf;
}
void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow
@nogc
{
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.
--
More information about the Digitalmars-d-bugs
mailing list