www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 13399] New: va_arg is nothrow yet may throw

https://issues.dlang.org/show_bug.cgi?id=13399

          Issue ID: 13399
           Summary: va_arg is nothrow yet may throw
           Product: D
           Version: D2
          Hardware: x86_64
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: code dawg.eu

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

--
Aug 29 2014