diff options
author | Jakub Jelinek <jakub@redhat.com> | 2008-07-29 18:29:33 +0200 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2008-07-29 18:29:33 +0200 |
commit | eb9c434c0fa298c0fcb7172f5761970891dead8a (patch) | |
tree | 15c1e6e162b23f0c7c5bceaffb233c6f0ed15adb /gcc/cp/tree.c | |
parent | 11cc4546906b5b73b367b7e14df85281fbed04db (diff) | |
download | gcc-eb9c434c0fa298c0fcb7172f5761970891dead8a.zip gcc-eb9c434c0fa298c0fcb7172f5761970891dead8a.tar.gz gcc-eb9c434c0fa298c0fcb7172f5761970891dead8a.tar.bz2 |
re PR c++/36852 (Two dimensional array in template method argument list incorrectly interpreted.)
PR c++/36852
* tree.c (cplus_array_hash, build_cplus_array_type_1): Hash on
TYPE_UID instead of pointers.
* g++.dg/pch/array-1.C: New test.
* g++.dg/pch/array-1.Hs: New file.
From-SVN: r138250
Diffstat (limited to 'gcc/cp/tree.c')
-rw-r--r-- | gcc/cp/tree.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/gcc/cp/tree.c b/gcc/cp/tree.c index 0522ae2..50c3049 100644 --- a/gcc/cp/tree.c +++ b/gcc/cp/tree.c @@ -504,9 +504,9 @@ cplus_array_hash (const void* k) hashval_t hash; const_tree const t = (const_tree) k; - hash = (htab_hash_pointer (TREE_TYPE (t)) - ^ htab_hash_pointer (TYPE_DOMAIN (t))); - + hash = TYPE_UID (TREE_TYPE (t)); + if (TYPE_DOMAIN (t)) + hash ^= TYPE_UID (TYPE_DOMAIN (t)); return hash; } @@ -553,8 +553,9 @@ build_cplus_array_type_1 (tree elt_type, tree index_type) cplus_array_htab = htab_create_ggc (61, &cplus_array_hash, &cplus_array_compare, NULL); - hash = (htab_hash_pointer (elt_type) - ^ htab_hash_pointer (index_type)); + hash = TYPE_UID (elt_type); + if (index_type) + hash ^= TYPE_UID (index_type); cai.type = elt_type; cai.domain = index_type; |