Bug 71504 - Compilation errors with -U__GNUC__ flag using STL header string
Compilation errors with -U__GNUC__ flag using STL header string
Product: Red Hat Linux
Classification: Retired
Component: gcc (Show other bugs)
i686 Linux
high Severity medium
: ---
: ---
Assigned To: Jakub Jelinek
Brian Brock
Depends On:
  Show dependency treegraph
Reported: 2002-08-14 10:45 EDT by Need Real Name
Modified: 2007-03-26 23:55 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2002-08-16 04:50:20 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
Log file of the compilation errors generated (1.20 KB, text/plain)
2002-08-14 10:47 EDT, Need Real Name
no flags Details

  None (edit)
Description Need Real Name 2002-08-14 10:45:55 EDT
Description of Problem:
Getting compilation errors while compiling  a particular .cpp file which
includes STL header file <string> , with flag __GNUC__ undefined.

Version-Release number of selected component (if applicable):
gcc 2.96-98

How Reproducible:

Steps to Reproduce:
1.  Create a cpp source file as follows:
#include <string>

int main() { 
  string s(10u, ' ');           // Create a string of ten blanks.

  const char* A = "this is a test";
  s += A;
  cout << "s = " << (s + '\n');

2. Compile the above source file with flag -U__GNUC__ 
e.g. g++ -U__GNUC__ stl.cpp

Actual Results:
Please refer to the attached log file (error.log) for the error messages

Expected Results:
The above source file should get compiled.

Additional Information:
The problem seems to be with /usr/include/g++-3/std/bastring.h
If the macro __STL_CLASS_PARTIAL_SPECIALIZATION is not defined, then the number
of parameters passed to class reverse_iterator needs to be different.
Comment 1 Need Real Name 2002-08-14 10:47:45 EDT
Created attachment 70604 [details]
Log file of the compilation errors generated
Comment 2 Jakub Jelinek 2002-08-16 02:26:58 EDT
Why are you doing that? The old libstdc++ certainly is not meant to be used
by compilers other than g++.
Comment 3 Need Real Name 2002-08-16 04:50:15 EDT
We need to use this flag -U__GNUC__  while using EDG because the EDG version
2.45.2 does not support g++ extensions. And one of our customers wants to
include stl header string while generating the front end with EDG.

Please have a look on the following typedef in /usr/include/g++-3/stl_rope.h :

        typedef reverse_iterator<const_iterator> const_reverse_iterator;
        typedef reverse_iterator<const_iterator, value_type, const_reference,
                                 difference_type>  const_reverse_iterator;

Why don't we have a similar typedef done in /usr/include/g++-3/std/bastring.h?
Comment 4 Jakub Jelinek 2002-08-16 05:48:23 EDT
With EDG frontend the corresponding STL should be used.
With STL from gcc 3.x you'll have even much harder time to use it with
another frontend...

Note You need to log in before you can comment on or make changes to this bug.