This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
libstdc++/2079: iostream.h needs more using declarations
- To: gcc-gnats at gcc dot gnu dot org
- Subject: libstdc++/2079: iostream.h needs more using declarations
- From: dbaron at fas dot harvard dot edu
- Date: 24 Feb 2001 01:35:43 -0000
- Cc: scc at mozilla dot org
- Reply-To: dbaron at fas dot harvard dot edu
>Number: 2079
>Category: libstdc++
>Synopsis: iostream.h needs more using declarations
>Confidential: no
>Severity: serious
>Priority: high
>Responsible: unassigned
>State: open
>Class: rejects-legal
>Submitter-Id: net
>Arrival-Date: Fri Feb 23 17:36:02 PST 2001
>Closed-Date:
>Last-Modified:
>Originator: L. David Baron
>Release: unknown-1.0
>Organization:
>Environment:
Using gcc and libstdc++ from gcc-3_0-branch:
gcc version 3.0 20010222 (prerelease)
>Description:
The backwards-compatibility header <iostream.h> needs more
|using| declarations to compile old code. In particular,
the following two are needed to compile Mozilla with the
gcc-3_0-branch:
using std::hex;
using std::dec;
There are probably a number of others that are needed as
well (although not for Mozilla).
>How-To-Repeat:
Create a C++ file containing the following:
-----
#include <iostream.h>
int main()
{
cout << hex << 12 << endl; // should output "c"
return 0;
}
-----
and compile with g++. It gives the error:
test.cpp: In function `int main()':
test.cpp:6: `hex' undeclared (first use this function)
test.cpp:6: (Each undeclared identifier is reported only once for each function it appears in.)
This file compiles with older releases of gcc and (presumably) with all the other C++ compilers that can
compile Mozilla. If I add the two lines I mentioned above
to iostream.h, the file compiles correctly.
>Fix:
>Release-Note:
>Audit-Trail:
>Unformatted: