When I try to recompile a betterC application (developed under 2.095.0), I get the following NEW error. I do not use expceptions.
dmd -I/home/larry/Github/escheme-dbc/src -c -od=/home/larry/Github/escheme-dbc/src -betterC -O -release -inline -boundscheck=off /home/larry/Github/escheme-dbc/src/main.d
/home/larry/dlang/dmd-2.096.0/linux/bin64/../../src/druntime/import/core/internal/lifetime.d(35): Error: Cannot use try-catch statements with -betterC
/home/larry/dlang/dmd-2.096.0/linux/bin64/../../src/druntime/import/core/internal/lifetime.d(57): Error: template instance `core.internal.lifetime.emplaceRef!(Vector!(void function()), Vector!(void function()), int).emplaceRef.S.__ctor!()` error instantiating
/home/larry/dlang/dmd-2.096.0/linux/bin64/../../src/druntime/import/core/lifetime.d(61): instantiated from here: `emplaceRef!(Vector!(void function()), Vector!(void function()), int)`
I do not use exceptions anywhere in this application. The application compiles find under 2.965.0. I pressume the aforementioned package DID star using exceptions and now is invalid for betterC use.
Can you please provide a minimal snippet that reproduces your error?
I cannot access the repo provided.
I've tested the snippet below with the latest druntime (4f6a249dedbba2fa556ec7a4e642188f0d7bec7f) and it doesn't reproduce the reported issue.
```
{
struct S
{
int i;
this(S other) { assert(false); }
this(int i) { this.i = i; }
}
S a;
auto b = S(5);
emplace(&a, b);
assert(a.i == 5);
}
```
emplace() and emplaceRef() can be used within -betterC code.
Comment #3 by moonlightsentinel — 2022-03-27T10:41:41Z