[PATCH] kdtree.hpp: qualify base class calls

Max Kellermann max at duempel.org
Fri Jun 11 07:22:32 UTC 2010


kdtree.hpp does not compile with LLVM's clang++ compiler, because it
violates the C++ standard, resulting in the error message:

 "must qualify identifier to find this declaration in dependent base
 class"

This is best explained on the clang home page:

 http://clang.llvm.org/cxx_compatibility.html

"When we look up a name used in a class, we usually look into the base
classes. However, we can't look into the base class Base<T> because
its type depends on the template argument T, so the standard says we
should just ignore it."
---
 kdtree++/kdtree.hpp |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/kdtree++/kdtree.hpp b/kdtree++/kdtree.hpp
index 62464a3..706d58d 100644
--- a/kdtree++/kdtree.hpp
+++ b/kdtree++/kdtree.hpp
@@ -1169,7 +1169,7 @@ namespace KDTree
       {
          typename _Base::NoLeakAlloc noleak(this);
          _Link_type new_node = noleak.get();
-         _M_construct_node(new_node, __V, __PARENT, __LEFT, __RIGHT);
+         _Base::_M_construct_node(new_node, __V, __PARENT, __LEFT, __RIGHT);
          noleak.disconnect();
          return new_node;
       }
@@ -1187,8 +1187,8 @@ namespace KDTree
       void
       _M_delete_node(_Link_type __p)
       {
-        _M_destroy_node(__p);
-        _M_deallocate_node(__p);
+        _Base::_M_destroy_node(__p);
+        _Base::_M_deallocate_node(__p);
       }
 
       _Link_type _M_root;




More information about the libkdtree-devel mailing list