]> git.ipfire.org Git - thirdparty/pdns.git/commit
SuffixMatchTree: Fix compilation on old libstdc++
authorRemi Gacogne <remi.gacogne@powerdns.com>
Fri, 20 May 2022 10:00:09 +0000 (12:00 +0200)
committerRemi Gacogne <remi.gacogne@powerdns.com>
Wed, 1 Jun 2022 09:32:36 +0000 (11:32 +0200)
commit65cd686f1613075ea7fd55a76d92ad9545065eb4
treefa04a8a4edcff3157495b2da2a5c89ea77cc7835
parent43075548735773013666b83dc29c8fb6d3c9159c
SuffixMatchTree: Fix compilation on old libstdc++

Move the < operator definition before the set one, so that old versions
of libstdc++ do not mistakenly refuse to compile:
```
In file included from /usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/map:60:
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_tree.h:452:7: error: static_assert failed due to requirement 'std::__is_invocable<std::less<void> &, const SuffixMatchTree<bool> &, const SuffixMatchTree<bool> &>{}' "comparison object must be invocable with two arguments of key type"
      static_assert(__is_invocable<_Compare&, const _Key&, const _Key&>{},
      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/bin/../lib/gcc/x86_64-linux-gnu/8/../../../../include/c++/8/bits/stl_set.h:133:17: note: in instantiation of template class 'std::_Rb_tree<SuffixMatchTree<bool>, SuffixMatchTree<bool>, std::_Identity<SuffixMatchTree<bool> >, std::less<void>, std::allocator<SuffixMatchTree<bool> > >' requested here
      _Rep_type _M_t;  // Red-black tree representing set.
                ^
../../pdns/dnsname.hh:306:50: note: in instantiation of template class 'std::set<SuffixMatchTree<bool>, std::less<void>, std::allocator<SuffixMatchTree<bool> > >' requested here
  mutable std::set<SuffixMatchTree, std::less<>> children;
                                                 ^
../../pdns/dnsname.hh:497:27: note: in instantiation of template class 'SuffixMatchTree<bool>' requested here
    SuffixMatchTree<bool> d_tree;
                          ^
```
Sseen with clang8 on Buster, but see also
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85965
pdns/dnsname.hh