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.
Created attachment 70604 [details] Log file of the compilation errors generated
Why are you doing that? The old libstdc++ certainly is not meant to be used by compilers other than g++.
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?
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...