Bug 21837 – Emplace depends on exceptions?

Status
RESOLVED
Resolution
WORKSFORME
Severity
regression
Priority
P3
Component
druntime
Product
D
Version
D2
Platform
All
OS
Linux
Creation time
2021-04-17T14:00:37Z
Last change time
2022-03-27T10:41:41Z
Keywords
betterC
Assigned to
No Owner
Creator
Larry Jordan

Comments

Comment #0 by larry.jordan — 2021-04-17T14:00:37Z
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.
Comment #1 by larry.jordan — 2021-04-17T14:52:01Z
My apologies for the early morning misspellings. Here is the Github project in D_betterC: https://github.com/LittleGreyCells/escheme-dbc.git
Comment #2 by edi33416 — 2021-12-07T14:19:58Z
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
The referenced repository isn't accessible but the bug was probably fixed by https://github.com/dlang/dmd/pull/12277