Bug 13399 – va_arg is nothrow yet may throw

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
druntime
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-08-29T23:12:00Z
Last change time
2015-02-18T03:37:42Z
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2014-08-29T23:12:17Z
cat > bug.d << CODE import core.vararg; struct Foo { this(this) {} } extern(C) void bug(int nargs, ...) { va_list ap; va_start(ap, __va_argsave); Foo foo; va_arg(ap, foo); } CODE dmd -c bug.d ---- /usr/include/dmd/druntime/import/core/stdc/stdarg.d(215): Error: 'bug.Foo.__cpctor' is not nothrow /usr/include/dmd/druntime/import/core/stdc/stdarg.d(205): Error: function 'core.stdc.stdarg.va_arg!(Foo).va_arg' is nothrow yet may throw bug.d(10): Error: template instance core.stdc.stdarg.va_arg!(Foo) error instantiating ---- Worked with 2.065.0 Introduced by https://github.com/D-Programming-Language/druntime/commit/08c5faccfe1427e7bae5f71f7c511df41f041ef2 with https://github.com/D-Programming-Language/druntime/pull/745
Comment #1 by public — 2014-08-30T14:06:19Z
Have encountered same issue when trying to build vibe.d newsgroup server. Looking at the content of the `stdarg` module it doesn't feel like module-wide `nothrow` is applicable there at all, there are just too many things that can throw indirectly. In my opinion this needs to be reverted and `nothrow` added on per-function basis
Comment #2 by github-bugzilla — 2014-08-30T17:48:07Z
Comment #3 by github-bugzilla — 2015-02-18T03:37:42Z