www.digitalmars.com         C & C++   DMDScript  

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


          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);

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

Worked with 2.065.0
Introduced by
with https://github.com/D-Programming-Language/druntime/pull/745

Aug 29 2014