the following testcase from KDE source can not be compiled with gcc 4.1 or newer:
=== Cut === int qHash(char key); int qHash(int key); template <class Key> struct QHash { void findNode(const Key &key) { qHash(key); } }; namespace khtml { struct Font { struct ScalKey { }; }; } int qHash (const khtml::Font::ScalKey& key); static QHash<khtml::Font::ScalKey>* scalCache; void isFontScalable() { khtml::Font::ScalKey key; scalCache->findNode(key); } === Cut === font-testcase.cpp: In member function ‘void QHash<Key>::findNode(const Key&) [with Key = khtml::Font::ScalKey]’: font-testcase.cpp:29: instantiated from here font-testcase.cpp:6: error: no matching function for call to ‘qHash(const khtml::Font::ScalKey&)’ font-testcase.cpp:1: note: candidates are: int qHash(char) font-testcase.cpp:2: note: int qHash(int) -- Summary: [4.1/4.2 Regression] ambiguous overload errors Product: gcc Version: 4.1.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: mueller at gcc dot gnu dot org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26311