Issue Details (XML | Word | Printable)

Key: STDCXX-326
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::ios_base::io_state not an integer type

Created: 19/Jan/07 09:36 PM   Updated: 19/Jan/07 11:03 PM
Return to search
Component/s: 27. Input/Output
Affects Version/s: 4.1.2, 4.1.3
Fix Version/s: 4.2.0

Time Tracking:
Not Specified

Environment: all

Resolved: 19/Jan/07 11:03 PM
Resolution Date: 19/Jan/07 11:03 PM


 Description  « Hide
depr.ios.members, p2 requires that std::ios_base::io_state be an integer type. The program below fails to compile, indicating that in stdcxx it is not:

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

int main ()
{
const int i = 1;
std::ios_base::io_state s = i;
}

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 6: error #144: a value of type "int" cannot be used to
initialize an entity of type "std::ios_base::io_state"
std::ios_base::io_state s = i;
^

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 added a comment - 19/Jan/07 09:42 PM
The other two deprecated types, open_mode and seek_dir, have the same problem:

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

void foo (std::ios::io_state, std::ios::open_mode, std::ios::seek_dir) { }

int main ()
{
foo (1, 2, 3);
}

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 7: error #167: argument of type "int" is incompatible with
parameter of type "std::ios_base::io_state"
foo (1, 2, 3);
^

"t.cpp", line 7: error #167: argument of type "int" is incompatible with
parameter of type "std::ios_base::open_mode"
foo (1, 2, 3);
^

"t.cpp", line 7: error #167: argument of type "int" is incompatible with
parameter of type "std::ios_base::seek_dir"
foo (1, 2, 3);
^

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


Repository Revision Date User Message
ASF #497965 Fri Jan 19 21:45:22 UTC 2007 sebor 2007-01-19 Martin Sebor <sebor@roguewave.com>

STDCXX-326
* _iosbase.h (seek_dir, io_state, open_mode): Declared as int.
Files Changed
MODIFY /incubator/stdcxx/trunk/include/rw/_iosbase.h

Martin Sebor made changes - 19/Jan/07 09:46 PM
Field Original Value New Value
Assignee Martin Sebor [ sebor ]
Martin Sebor made changes - 19/Jan/07 09:46 PM
Status Open [ 1 ] In Progress [ 3 ]
Martin Sebor added a comment - 19/Jan/07 11:03 PM
Fixed with the referenced patch. Need to add a test.

Martin Sebor made changes - 19/Jan/07 11:03 PM
Status In Progress [ 3 ] Resolved [ 5 ]
Fix Version/s 4.2 [ 12311945 ]
Resolution Fixed [ 1 ]