Issue Details (XML | Word | Printable)

Key: STDCXX-323
Type: Bug Bug
Status: Resolved Resolved
Resolution: Fixed
Priority: Major Major
Assignee: Martin Sebor
Reporter: Martin Sebor
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
C++ Standard Library

std::div(long, long) overload missing from <cstdlib>

Created: 19/Jan/07 05:52 PM   Updated: 19/Jan/07 06:52 PM
Return to search
Component/s: 26. Numerics
Affects Version/s: 4.1.2, 4.1.3
Fix Version/s: 4.2.0

Time Tracking:
Not Specified

Environment: EDG eccp/Solaris

Resolved: 19/Jan/07 06:12 PM
Resolution Date: 19/Jan/07 06:12 PM


 Description  « Hide
The well-formed program below fails to compile with 4.1.2. According to c.math, p8, the C++ header <cstdlib> adds an overload of div(long, long) that returns ldiv_t to the C function div(int, int) that returns div_t. Looks like we're missing that overload.

$ cat t.cpp && make t
#include <cstdlib>

int main ()
{
std::ldiv_t x = std::div (1L, 1L);
}

eccp -c -I/build/sebor/dev/stdlib/include/ansi -D_RWSTDDEBUG -D_RWSTD_USE_CONFIG -I/build/sebor/dev/stdlib/include -I/build/sebor/eccp-3.8-11s/include -I/build/sebor/dev/stdlib/include/ansi -I/build/sebor/PlumHall/lvs06a/conform -I/build/sebor/PlumHall/lvs06a/dst.3 -A -x --template_directory=/build/sebor/eccp-3.8-11s/lib -g --display_error_number --remarks --diag_suppress 193,236,340,401,261,479,487,678,679,815 --diag_suppress 177,381,191,68,550,611,997,549 t.cpp
"t.cpp", line 5: error #312: no suitable user-defined conversion from
"std::div_t" to "std::ldiv_t" exists
std::ldiv_t x = std::div (1L, 1L);
^

1 error detected in the compilation of "t.cpp".
make: *** [t.o] Error 2



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Martin Sebor made changes - 19/Jan/07 05:57 PM
Field Original Value New Value
Assignee Martin Sebor [ sebor ]
Martin Sebor made changes - 19/Jan/07 05:57 PM
Status Open [ 1 ] In Progress [ 3 ]
Martin Sebor made changes - 19/Jan/07 06:12 PM
Resolution Fixed [ 1 ]
Fix Version/s 4.2 [ 12311945 ]
Status In Progress [ 3 ] Resolved [ 5 ]
Martin Sebor made changes - 19/Jan/07 06:52 PM
Environment all EDG eccp/Solaris