[PATCH] kdtree.hpp: qualify base class calls

Sylvain Bougerel sylvain.bougerel.devel at gmail.com
Sun Jun 13 13:55:23 UTC 2010


Hi,

I committed Max's patch on the origin/master branch.

Regards,
Sylvain

On 12 Jun 2010 00:12, "Sylvain Bougerel" <sylvain.bougerel.devel at gmail.com>
wrote:
> Thanks for the patch Max. If I can't put it in the code tomorrow, I'll
check
> if others can do it.
>
> On 11 Jun 2010 15:32, "Max Kellermann" <max at duempel.org> wrote:
>> 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;
>>
>>
>> _______________________________________________
>> libkdtree-devel mailing list
>> libkdtree-devel at lists.alioth.debian.org
>> http://lists.alioth.debian.org/mailman/listinfo/libkdtree-devel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/libkdtree-devel/attachments/20100613/5eb137f4/attachment.htm>


More information about the libkdtree-devel mailing list