[Bug 68379] New: GCC 3.3.1 TEMPLATE PROBLEMS
dragon at panix.com
dragon at panix.com
Sun Nov 16 15:57:04 UTC 2003
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=68379
Summary: GCC 3.3.1 TEMPLATE PROBLEMS
Product: kdevelop
Version: 3.0.0b1
Platform: SuSE RPMs
OS/Version: Linux
Status: UNCONFIRMED
Severity: normal
Priority: NOR
Component: general
AssignedTo: kdevelop-devel at kdevelop.org
ReportedBy: dragon at panix.com
Version: 3.0.0b1 (using KDE 3.1.4)
Installed from: SuSE
Compiler: gcc version 3.3.1 (SuSE Linux)
OS: Linux (i686) release 2.4.21-99-athlon
This is not so much a KDE problem as it is a GCC problem
However, that are some serious issue about GCC template handleing
ex. Given the following two output operators
//
//
//
std::ostream& operator <<(std::ostream& os, const Authorization::db_to_info_t& p)
{
os << "Database Id: " << std::hex << p.first << std::dec
<< "\tCreation Transaction#: " << p.second.creation_transaction_no
<< "\tUpdate Version: " << unsigned(p.second.update_version);
return os;
}
std::ostream& operator <<(std::ostream& os, const DatabaseDefinitions::db_to_db_info_t& p)
{
os << p.second->database_name << "="
<< std::hex << p.first << std::dec << " "
<< p.second->number_of_record << " "
<< p.second->base_record_lenght << " "
<< p.second->eqs_record_lenght << " "
<< p.second->xRefFileName() << " "
<< p.second->security_type.security_type_number << "="
<< p.second->security_type.name << " "
<< p.second->number_of_base_fields << " "
<< p.second->number_of_eqs_fields;
os << std::endl;
for (field_list_t::const_iterator i = p.second->fields.begin(); i != p.second->fields.end(); ++i)
os << (*i)->field_name() << " ";
os << std::endl;
return os;
}
The following lines of code
std::cout << "Database Definitions" << std::endl;
for (DatabaseDefinitions::map_t::const_iterator i = Database_Definitions->database_information().begin(); i != Database_Definitions->database_information().end(); ++i)
std::cout << *i << std::endl;
Generates errors
/home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:147: error: ambiguous overload for 'operator<<' in 'std::cout << (&i)->std::_Rb_tree_iterator<_Val, _Ref, _Ptr>::operator*() const [with _Val = std::pair<const long unsigned int, DTN::Database::database_information_s*>, _Ref = const std::pair<const long unsigned int, DTN::Database::database_information_s*>&, _Ptr = const std::pair<const long unsigned int, DTN::Database::database_information_s*>*]()'
* /home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:74: error: candidates are: std::ostream& operator<<(std::ostream&, const std::pair<long unsigned int, DTN::IO::ResponseToAuthorizeDatabase::a_db_authorization>&)
* /home/XMan/Documents/C++/DTN/dtnserver/src/verbose_display.cpp:106: error: std::ostream& operator<<(std::ostream&, const std::pair<long unsigned int, DTN::Database::database_information_s*>&)
The GCC template handling functions can't tell the difference between the two operators.
More information about the KDevelop-devel
mailing list