HomePhabricator

Fix compilation error in radix.h for older compilers

Description

Fix compilation error in radix.h for older compilers

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

Reviewers: deadalnix, #bitcoin_abc

Reviewed By: deadalnix, #bitcoin_abc

Subscribers: teamcity, schancel

Differential Revision: https://reviews.bitcoinabc.org/D2403

Details

Provenance
jasonbcoxAuthored on Jan 23 2019, 23:53
jasonbcoxPushed on Jan 24 2019, 00:22
Reviewer
Restricted Project
Differential Revision
D2403: Fix compilation error in radix.h for older compilers
Parents
rABCa31d8c0f1111: Add `-debuglogfile` option
Branches
Unknown
Tags
Unknown