Description of problem: When compiling code that uses the typename keyword against a template that hasn't been typedef'd (I'm actually not sure how best to describe it... but it's trivial to reproduce) then you get a segmentation fault. Version-Release number of selected component (if applicable): The version of Linux (uname -a) is actually: Linux vanpglnx29 2.6.9-5.ELsmp #1 SMP Wed Jan 5 19:30:39 EST 2005 i686 i686 i386 GNU/Linux and the version of gcc (gcc --version) is: gcc (GCC) 3.4.3 20041212 (Red Hat 3.4.3-9.EL4) How reproducible: Every time. Steps to Reproduce: Compile the following cpp program using gcc (e.g. gcc test.cpp). Actual results: Segmentation fault. Expected results: No segmentation fault. Additional info: Try to compile this code: #include <map> using namespace std; int main (int argv, char** argc) { map<int,int> mymap; mymap.insert(typename map<int,int>::value_type(1,1)); return 0; }
This report is confusing because RHEL3 doesn't ship gcc-3.4.3-9.EL4. In any case, this is correctly flagged as an error without any internal compiler errors in current RHEL4 updates: rpm -q gcc-c++; g++ a.C gcc-c++-3.4.6-3 a.C: In function `int main(int, char**)': a.C:6: error: using `typename' outside of template Even RHEL3 gcc-3.2.3-56 issues the same error.
*** Bug 204394 has been marked as a duplicate of this bug. ***