This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/24811] New: Wrong compile template class with itetrator inside this class.See example.
- From: "android at cn dot ru" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Nov 2005 20:21:57 -0000
- Subject: [Bug c++/24811] New: Wrong compile template class with itetrator inside this class.See example.
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
This Source:
template <typename Key,typename Value>
27 class mutant_iter
28 {
29 private:
30 std::vector<Value> *Vector;
31 std::multimap<Key,int> *Mmap;
32 std::multimap<Key,int>::iterator iter;
33 };
try to compile:
g++ src.cpp -pedantic -Wall -o bin
GCC print:
mutant.cpp:32: error: expected ?;? before ?iter?
Other compilers( Borland C++ Bilder 6.0 for example) compile this sorce
correctly.
Modify this source:
27 class mutant_iter
28 {
29 private:
30 std::vector<Value> *Vector;
31 std::multimap<Key,int> *Mmap;
32 std::multimap<Key,int>::iterator; //without iterator name!
33 };
compiled correctly, witout errors or warnings.
--
Summary: Wrong compile template class with itetrator inside this
class.See example.
Product: gcc
Version: 4.0.0
Status: UNCONFIRMED
Severity: major
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: android at cn dot ru
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=24811