Page MenuHomePhabricator

Fix compilation error in radix.h for older compilers
ClosedPublic

Authored by jasonbcox on Jan 23 2019, 23:55.

Details

Summary

gcc5 gives an error like this:

In file included from ../src/test/radix_tests.cpp:5:
In file included from ../src/./radix.h:8:
In file included from ../src/./rcu.h:10:
/usr/bin/../lib/gcc/x86_64-linux-gnu/5.4.0/../../../../include/c++/5.4.0/atomic:185:7: error: exception specification of explicitly defaulted default constructor does not match the calculated one
     atomic() noexcept = default;
     ^
../src/./radix.h:53:31: note: in instantiation of template class 'std::atomic<RadixTree<radix_tests::TestElement<unsigned long> >::RadixElement>' requested here
   std::atomic<RadixElement> root;
                             ^
../src/test/radix_tests.cpp:34:18: note: in instantiation of template class 'RadixTree<radix_tests::TestElement<unsigned long> >' requested here
   RadixTree<E> mytree;
                ^
../src/test/radix_tests.cpp:86:5: note: in instantiation of function template specialization 'radix_tests::testInsert<unsigned long>' requested here
   testInsert<uint64_t>();
   ^

https://cplusplus.github.io/LWG/lwg-unresolved.html for extra context on the issue before it was fixed in newer versions of gcc (ctrl+f for atomic() noexcept for the relevant section)

Test Plan

make check
ninja check

Diff Detail

Repository
rABC Bitcoin ABC
Branch
master
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 4675
Build 7413: Bitcoin ABC Buildbot (legacy)
Build 7412: arc lint + arc unit