www.digitalmars.com         C & C++   DMDScript  

c++ - std::numeric_limits --- Internal error

Simple 2 line source file:

#include <limits>
double foo = std::numeric_limits<double>::infinity();

Compile with

dmc -cpp foo.cc


Internal error: blockopt.c 485
--- errorlevel 1

If I throw -v onto the compile command the last bit is

operator ==
operator !=
class std::_F_rep
class std::_D_rep
class std::_L_rep
class std::std::_Numeric_limits_base<double >
class std::std::_Floating_limits<double 
class std::std::numeric_limits<double >
Internal error: blockopt.c 485

--- errorlevel 1

OTOH, it works OK if "double foo = ..." is placed inside a 
function (i.e., not at file or global scope).
Also, using INFINITY from <cmath> in place of 
std::numeric_limits<double>::infinity() works OK.

I see this with both dmc 8.52c and dmc 8.56c.  I'm using stlport 


I see the above problem with NaNs too.
Mar 05 2013