Bug 71504 - Compilation errors with -U__GNUC__ flag using STL header string
Summary: Compilation errors with -U__GNUC__ flag using STL header string
Keywords:
Status: CLOSED WONTFIX
Alias: None
Product: Red Hat Linux
Classification: Retired
Component: gcc
Version: 7.2
Hardware: i686
OS: Linux
high
medium
Target Milestone: ---
Assignee: Jakub Jelinek
QA Contact: Brian Brock
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2002-08-14 14:45 UTC by Need Real Name
Modified: 2007-03-27 03:55 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2002-08-16 08:50:20 UTC
Embargoed:


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

Description Need Real Name 2002-08-14 14:45:55 UTC
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:
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
generated.

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 14:47:45 UTC
Created attachment 70604 [details]
Log file of the compilation errors generated

Comment 2 Jakub Jelinek 2002-08-16 06:26:58 UTC
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 08:50:15 UTC
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 :

#     ifdef __STL_CLASS_PARTIAL_SPECIALIZATION
        typedef reverse_iterator<const_iterator> const_reverse_iterator;
#     else /* __STL_CLASS_PARTIAL_SPECIALIZATION */
        typedef reverse_iterator<const_iterator, value_type, const_reference,
                                 difference_type>  const_reverse_iterator;
#     endif /* __STL_CLASS_PARTIAL_SPECIALIZATION */

Why don't we have a similar typedef done in /usr/include/g++-3/std/bastring.h?

Comment 4 Jakub Jelinek 2002-08-16 09:48:23 UTC
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.