Bug 19396 – [betterC] ScopeBuffer can't be used in betterC with inline

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-11-13T12:02:53Z
Last change time
2018-11-20T23:05:17Z
Assigned to
No Owner
Creator
Radu Racariu
See also
https://issues.dlang.org/show_bug.cgi?id=19416

Comments

Comment #0 by radu.racariu — 2018-11-13T12:02:53Z
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.
Comment #1 by github-bugzilla — 2018-11-20T23:05:16Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/7c8d75b72ee589dee042fc230434448fd309b9a0 Fix Issue 19396 - ScopeBuffer can't be used in betterC with inline https://github.com/dlang/phobos/commit/a66435ea903c6115a7e61b141bf6e31f7e5347dd Merge pull request #6764 from rracariu/master Fix Issue 19396 - ScopeBuffer can't be used in betterC with inline merged-on-behalf-of: Petar Kirov <[email protected]>