public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] PR bootstrap/61679 playcate old gcc
@ 2014-07-08  2:21 tsaunders
  2014-07-08 10:42 ` Richard Biener
  0 siblings, 1 reply; 2+ messages in thread
From: tsaunders @ 2014-07-08  2:21 UTC (permalink / raw)
  To: gcc-patches; +Cc: Trevor Saunders

From: Trevor Saunders <tsaunders@mozilla.com>

Hi,

I'll admitt I'm not actually sure if the spec requires this, or if gcc 4.5 was
too picky, but this fixes the build with gcc 4.5, and it doesn't really hurt
anything.

bootstrapped + regtested on x86_64-unknown-linux-gnu with no regressions, ok?

Trev

gcc/

	PR bootstrap/61679
	 * hash-table.h: use hash_table::value_type instead of
       	Descriptor::value_type in the return types of several methods.

diff --git a/gcc/hash-table.h b/gcc/hash-table.h
index 22af12f..9c6a34a 100644
--- a/gcc/hash-table.h
+++ b/gcc/hash-table.h
@@ -663,7 +663,7 @@ hash_table<Descriptor, Allocator, false>::~hash_table ()
    HASH is the hash value for the element to be inserted.  */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type **
+typename hash_table<Descriptor, Allocator, false>::value_type **
 hash_table<Descriptor, Allocator, false>
 ::find_empty_slot_for_expand (hashval_t hash)
 {
@@ -803,7 +803,7 @@ hash_table<Descriptor, Allocator, false>::clear_slot (value_type **slot)
    be used to insert or delete an element. */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type *
+typename hash_table<Descriptor, Allocator, false>::value_type *
 hash_table<Descriptor, Allocator, false>
 ::find_with_hash (const compare_type *comparable, hashval_t hash)
 {
@@ -841,7 +841,7 @@ hash_table<Descriptor, Allocator, false>
    entry, NULL may be returned if memory allocation fails. */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type **
+typename hash_table<Descriptor, Allocator, false>::value_type **
 hash_table<Descriptor, Allocator, false>
 ::find_slot_with_hash (const compare_type *comparable, hashval_t hash,
 		       enum insert_option insert)
@@ -922,7 +922,9 @@ hash_table<Descriptor, Allocator, false>
 
 template<typename Descriptor, template<typename Type> class Allocator>
 template<typename Argument,
-	  int (*Callback) (typename Descriptor::value_type **slot, Argument argument)>
+	  int (*Callback) (typename hash_table<Descriptor, Allocator,
+					       false>::value_type **slot,
+			   Argument argument)>
 void
 hash_table<Descriptor, Allocator, false>::traverse_noresize (Argument argument)
 {
@@ -946,7 +948,8 @@ hash_table<Descriptor, Allocator, false>::traverse_noresize (Argument argument)
 template <typename Descriptor,
 	  template <typename Type> class Allocator>
 template <typename Argument,
-	  int (*Callback) (typename Descriptor::value_type **slot,
+	  int (*Callback) (typename hash_table<Descriptor, Allocator,
+					       false>::value_type **slot,
 			   Argument argument)>
 void
 hash_table<Descriptor, Allocator, false>::traverse (Argument argument)
@@ -1181,7 +1184,7 @@ hash_table<Descriptor, Allocator, true>::~hash_table ()
    HASH is the hash value for the element to be inserted.  */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type *
+typename hash_table<Descriptor, Allocator, true>::value_type *
 hash_table<Descriptor, Allocator, true>
 ::find_empty_slot_for_expand (hashval_t hash)
 {
@@ -1321,7 +1324,7 @@ hash_table<Descriptor, Allocator, true>::clear_slot (value_type *slot)
    be used to insert or delete an element. */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type &
+typename hash_table<Descriptor, Allocator, true>::value_type &
 hash_table<Descriptor, Allocator, true>
 ::find_with_hash (const compare_type &comparable, hashval_t hash)
 {
@@ -1358,7 +1361,7 @@ hash_table<Descriptor, Allocator, true>
    entry, NULL may be returned if memory allocation fails. */
 
 template<typename Descriptor, template<typename Type> class Allocator>
-typename Descriptor::value_type *
+typename hash_table<Descriptor, Allocator, true>::value_type *
 hash_table<Descriptor, Allocator, true>
 ::find_slot_with_hash (const compare_type &comparable, hashval_t hash,
 		       enum insert_option insert)
@@ -1440,7 +1443,8 @@ hash_table<Descriptor, Allocator, true>
 template<typename Descriptor,
 	  template<typename Type> class Allocator>
 template<typename Argument,
-	  int (*Callback) (typename Descriptor::value_type *slot,
+	  int (*Callback) (typename hash_table<Descriptor, Allocator,
+					       true>::value_type *slot,
 			   Argument argument)>
 void
 hash_table<Descriptor, Allocator, true>::traverse_noresize (Argument argument)
@@ -1465,7 +1469,8 @@ hash_table<Descriptor, Allocator, true>::traverse_noresize (Argument argument)
 template <typename Descriptor,
 	  template <typename Type> class Allocator>
 template <typename Argument,
-	  int (*Callback) (typename Descriptor::value_type *slot,
+	  int (*Callback) (typename hash_table<Descriptor, Allocator,
+					       true>::value_type *slot,
 			   Argument argument)>
 void
 hash_table<Descriptor, Allocator, true>::traverse (Argument argument)
-- 
2.0.1

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] PR bootstrap/61679 playcate old gcc
  2014-07-08  2:21 [PATCH] PR bootstrap/61679 playcate old gcc tsaunders
@ 2014-07-08 10:42 ` Richard Biener
  0 siblings, 0 replies; 2+ messages in thread
From: Richard Biener @ 2014-07-08 10:42 UTC (permalink / raw)
  To: tsaunders; +Cc: GCC Patches

On Tue, Jul 8, 2014 at 4:21 AM,  <tsaunders@mozilla.com> wrote:
> From: Trevor Saunders <tsaunders@mozilla.com>
>
> Hi,
>
> I'll admitt I'm not actually sure if the spec requires this, or if gcc 4.5 was
> too picky, but this fixes the build with gcc 4.5, and it doesn't really hurt
> anything.
>
> bootstrapped + regtested on x86_64-unknown-linux-gnu with no regressions, ok?

Ok.

Thanks,
Richard.

> Trev
>
> gcc/
>
>         PR bootstrap/61679
>          * hash-table.h: use hash_table::value_type instead of
>         Descriptor::value_type in the return types of several methods.
>
> diff --git a/gcc/hash-table.h b/gcc/hash-table.h
> index 22af12f..9c6a34a 100644
> --- a/gcc/hash-table.h
> +++ b/gcc/hash-table.h
> @@ -663,7 +663,7 @@ hash_table<Descriptor, Allocator, false>::~hash_table ()
>     HASH is the hash value for the element to be inserted.  */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type **
> +typename hash_table<Descriptor, Allocator, false>::value_type **
>  hash_table<Descriptor, Allocator, false>
>  ::find_empty_slot_for_expand (hashval_t hash)
>  {
> @@ -803,7 +803,7 @@ hash_table<Descriptor, Allocator, false>::clear_slot (value_type **slot)
>     be used to insert or delete an element. */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type *
> +typename hash_table<Descriptor, Allocator, false>::value_type *
>  hash_table<Descriptor, Allocator, false>
>  ::find_with_hash (const compare_type *comparable, hashval_t hash)
>  {
> @@ -841,7 +841,7 @@ hash_table<Descriptor, Allocator, false>
>     entry, NULL may be returned if memory allocation fails. */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type **
> +typename hash_table<Descriptor, Allocator, false>::value_type **
>  hash_table<Descriptor, Allocator, false>
>  ::find_slot_with_hash (const compare_type *comparable, hashval_t hash,
>                        enum insert_option insert)
> @@ -922,7 +922,9 @@ hash_table<Descriptor, Allocator, false>
>
>  template<typename Descriptor, template<typename Type> class Allocator>
>  template<typename Argument,
> -         int (*Callback) (typename Descriptor::value_type **slot, Argument argument)>
> +         int (*Callback) (typename hash_table<Descriptor, Allocator,
> +                                              false>::value_type **slot,
> +                          Argument argument)>
>  void
>  hash_table<Descriptor, Allocator, false>::traverse_noresize (Argument argument)
>  {
> @@ -946,7 +948,8 @@ hash_table<Descriptor, Allocator, false>::traverse_noresize (Argument argument)
>  template <typename Descriptor,
>           template <typename Type> class Allocator>
>  template <typename Argument,
> -         int (*Callback) (typename Descriptor::value_type **slot,
> +         int (*Callback) (typename hash_table<Descriptor, Allocator,
> +                                              false>::value_type **slot,
>                            Argument argument)>
>  void
>  hash_table<Descriptor, Allocator, false>::traverse (Argument argument)
> @@ -1181,7 +1184,7 @@ hash_table<Descriptor, Allocator, true>::~hash_table ()
>     HASH is the hash value for the element to be inserted.  */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type *
> +typename hash_table<Descriptor, Allocator, true>::value_type *
>  hash_table<Descriptor, Allocator, true>
>  ::find_empty_slot_for_expand (hashval_t hash)
>  {
> @@ -1321,7 +1324,7 @@ hash_table<Descriptor, Allocator, true>::clear_slot (value_type *slot)
>     be used to insert or delete an element. */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type &
> +typename hash_table<Descriptor, Allocator, true>::value_type &
>  hash_table<Descriptor, Allocator, true>
>  ::find_with_hash (const compare_type &comparable, hashval_t hash)
>  {
> @@ -1358,7 +1361,7 @@ hash_table<Descriptor, Allocator, true>
>     entry, NULL may be returned if memory allocation fails. */
>
>  template<typename Descriptor, template<typename Type> class Allocator>
> -typename Descriptor::value_type *
> +typename hash_table<Descriptor, Allocator, true>::value_type *
>  hash_table<Descriptor, Allocator, true>
>  ::find_slot_with_hash (const compare_type &comparable, hashval_t hash,
>                        enum insert_option insert)
> @@ -1440,7 +1443,8 @@ hash_table<Descriptor, Allocator, true>
>  template<typename Descriptor,
>           template<typename Type> class Allocator>
>  template<typename Argument,
> -         int (*Callback) (typename Descriptor::value_type *slot,
> +         int (*Callback) (typename hash_table<Descriptor, Allocator,
> +                                              true>::value_type *slot,
>                            Argument argument)>
>  void
>  hash_table<Descriptor, Allocator, true>::traverse_noresize (Argument argument)
> @@ -1465,7 +1469,8 @@ hash_table<Descriptor, Allocator, true>::traverse_noresize (Argument argument)
>  template <typename Descriptor,
>           template <typename Type> class Allocator>
>  template <typename Argument,
> -         int (*Callback) (typename Descriptor::value_type *slot,
> +         int (*Callback) (typename hash_table<Descriptor, Allocator,
> +                                              true>::value_type *slot,
>                            Argument argument)>
>  void
>  hash_table<Descriptor, Allocator, true>::traverse (Argument argument)
> --
> 2.0.1
>

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-08 10:42 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-08  2:21 [PATCH] PR bootstrap/61679 playcate old gcc tsaunders
2014-07-08 10:42 ` Richard Biener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).