www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12644] New: Some std.math functions are not yet nogc

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

          Issue ID: 12644
           Summary: Some std.math functions are not yet  nogc
           Product: D
           Version: D2
          Hardware: x86
                OS: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: enhancement
          Priority: P1
         Component: Phobos
          Assignee: nobody puremagic.com
          Reporter: bearophile_hugs eml.cc

void main()  nogc {
    import std.math: floor, ceil, round, asin, atan2;
    auto x = floor(2.2);
    auto y = ceil(2.2);
    auto z = round(2.2);
    auto r1 = asin(1.0);
    auto r2 = atan2(1.0, 1.0);
}


DMD 2.066alpha gives:

test.d(3,19): Error:  nogc function 'D main' cannot call non- nogc function
'std.math.floor'
test.d(4,18): Error:  nogc function 'D main' cannot call non- nogc function
'std.math.ceil'
test.d(5,19): Error:  nogc function 'D main' cannot call non- nogc function
'std.math.round'
test.d(6,19): Error:  nogc function 'D main' cannot call non- nogc function
'std.math.asin'
test.d(7,20): Error:  nogc function 'D main' cannot call non- nogc function
'std.math.atan2'

--
Apr 25 2014