# HG changeset patch # User mgerdin # Date 1338794513 -7200 # Node ID a297b0e146054517b95870274146b6ab867907f8 # Parent 6e2633440960afd711f294ab42e12a14fd521280 7172226: HotSpot fails to build with GCC 4.7 because of stricter c++ argument dependent lookup Summary: Add "using" keyword to import base class functions from FreeList to fix template name lookup in gcc 4.7 Reviewed-by: brutisso, iveresov diff -r 6e2633440960 -r a297b0e14605 src/share/vm/memory/binaryTreeDictionary.cpp --- a/src/share/vm/memory/binaryTreeDictionary.cpp Fri Jun 01 15:30:44 2012 -0700 +++ b/src/share/vm/memory/binaryTreeDictionary.cpp Mon Jun 04 09:21:53 2012 +0200 @@ -230,7 +230,7 @@ link_tail(chunk); assert(!tail() || size() == tail()->size(), "Wrong sized chunk in list"); - FreeList::increment_count(); + increment_count(); debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) assert(head() == NULL || head()->prev() == NULL, "list invariant"); assert(tail() == NULL || tail()->next() == NULL, "list invariant"); @@ -258,7 +258,7 @@ } head()->link_after(chunk); assert(!head() || size() == head()->size(), "Wrong sized chunk in list"); - FreeList::increment_count(); + increment_count(); debug_only(increment_returned_bytes_by(chunk->size()*sizeof(HeapWord));) assert(head() == NULL || head()->prev() == NULL, "list invariant"); assert(tail() == NULL || tail()->next() == NULL, "list invariant"); @@ -909,6 +909,7 @@ template class AscendTreeCensusClosure : public TreeCensusClosure { + using TreeCensusClosure::do_list; public: void do_tree(TreeList* tl) { if (tl != NULL) { @@ -921,6 +922,7 @@ template class DescendTreeCensusClosure : public TreeCensusClosure { + using TreeCensusClosure::do_list; public: void do_tree(TreeList* tl) { if (tl != NULL) { @@ -987,6 +989,7 @@ template class DescendTreeSearchClosure : public TreeSearchClosure { + using TreeSearchClosure::do_list; public: bool do_tree(TreeList* tl) { if (tl != NULL) { diff -r 6e2633440960 -r a297b0e14605 src/share/vm/memory/binaryTreeDictionary.hpp --- a/src/share/vm/memory/binaryTreeDictionary.hpp Fri Jun 01 15:30:44 2012 -0700 +++ b/src/share/vm/memory/binaryTreeDictionary.hpp Mon Jun 04 09:21:53 2012 +0200 @@ -60,13 +60,18 @@ TreeList* left() const { return _left; } TreeList* right() const { return _right; } - // Wrapper on call to base class, to get the template to compile. - Chunk* head() const { return FreeList::head(); } - Chunk* tail() const { return FreeList::tail(); } - void set_head(Chunk* head) { FreeList::set_head(head); } - void set_tail(Chunk* tail) { FreeList::set_tail(tail); } + // Explicitly import these names into our namespace to fix name lookup with templates + using FreeList::head; + using FreeList::set_head; - size_t size() const { return FreeList::size(); } + using FreeList::tail; + using FreeList::set_tail; + using FreeList::link_tail; + + using FreeList::increment_count; + NOT_PRODUCT(using FreeList::increment_returned_bytes_by;) + using FreeList::verify_chunk_in_free_list; + using FreeList::size; // Accessors for links in tree.