www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12649] New: "discards return value" warning will cause ICE on

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

          Issue ID: 12649
           Summary: "discards return value" warning will cause ICE on
                    function pointer call
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: ice
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody puremagic.com
          Reporter: k.hara.pg gmail.com

Test case:

int foo() pure nothrow { return 1; }
void main()
{
    auto fp = &foo;
    //foo();  // Warning: Call to function test.foo without side effects
              // discards return value
    fp();     // ICE!
}

--
Apr 25 2014