I use Parasoft's Insure++ memory usage analysis tool to detect invalid memory accesses and memory leaks. This tool performs both static and dynamic memory usage analysis by instrumenting the code during the compilation and link phases. Due to a PARSE_ERROR, Insure++ fails to compile code that uses unordered_map:
[hashtable:181] **PARSE_ERROR** Parse error. >> template<typename _Key2, typename _Pair, typename _Hashtable> too few template parameters -- does not match previous declaration The parse error occurs at line 181 of hashtable [i.e. /usr/include/c++/4.2.3/tr1/hashtable]: 181 template<typename _Key2, typename _Pair, typename _Hashtable> 182 friend struct __detail::_Map_base; where there appears to be an invalid friend declaration. The specified parameterized struct, __detail::_Map_base, was defined with five parameters in hashtable_policy.h as: 615 template<typename _Key, typename _Value, typename _Ex, bool __unique, 616 typename _Hashtable> 617 struct _Map_base { }; so it seems entirely reasonable that the friendship declaration should also employ five parameters. I modified the friendship declaration to conform with my expectations as follows (NOTE: there are five parameters): 181 template<typename _Key2, typename _Pair, typename _Ex, bool __unique, 182 typename _Hashtable> 183 friend struct __detail::_Map_base; and now Insure++ successfully parses the code, gcc successfully parses the code, and my application continues to behave correctly. QUESTION: Does anyone (with authority on the subject) agree that the current friendship declaration is incorrect? If so, need I do more than I have to realize a fix in a future release of gcc? ... Dave -- View this message in context: http://www.nabble.com/gcc-4.2.3%3A-unordered_map-implementation-causes-Insure%2B%2B-PARSE_ERROR-tp18853509p18853509.html Sent from the Gnu - Common C++ mailing list archive at Nabble.com. _______________________________________________ Bug-commoncpp mailing list Bug-commoncpp@gnu.org http://lists.gnu.org/mailman/listinfo/bug-commoncpp