Fix template_decl::hash::operator()
authorDodji Seketeli <dodji@redhat.com>
Mon, 12 Dec 2016 11:14:21 +0000 (12:14 +0100)
committerDodji Seketeli <dodji@redhat.com>
Mon, 12 Dec 2016 11:14:21 +0000 (12:14 +0100)
While hashing template_decl we inadvertently forget the contribution
of the name of the type to the hash.

This was spotted by Ondrej Oprala.

Fixed thus.

* src/abg-hash.cc (template_decl::hash::operator()): Combine the
contribution of the qualified name to the contribution of the type
name to the hash.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-hash.cc

index b05a54a7e085587710ff9bc724e46c153500b8af..49aef49063c0ad78349ec8d8c4c97b8eee30b9ab 100644 (file)
@@ -773,7 +773,7 @@ template_decl::hash::operator()(const template_decl& t) const
   template_parameter::shared_ptr_hash hash_template_parameter;
 
   size_t v = hash_string(typeid(t).name());
-  v = hash_string(t.get_qualified_name());
+  v = hashing::combine_hashes(v, hash_string(t.get_qualified_name()));
 
   for (list<template_parameter_sptr>::const_iterator p =
         t.get_template_parameters().begin();