llvm-project commit 54fa9ecd3088508b05b0c5b5cb52da8a3c188655 added semaphore.h to libcxx/include/__threading_support. This potentially creates a circular dependency if a libc++ header sees distributeddatamgr_datamgr's semaphore.h (services/distributeddataservice/libs/distributeddb/common/include/semaphore.h).
eg. compile a C++ source file that contains only #include <memory>
on a system with clang using recent version (after Feb 18, 2020) of libc++ and distributeddatamgr_datamgr's semaphore.h on the header search list:
cat test.cpp
#include <memory>
clang++ -c test.cpp -stdlib=libc++ -Ifoundation/distributeddatamgr/distributeddatamgr/services/distributeddataservice/libs/distributeddb/common/include/
In file included from test.cpp:1:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/memory:681:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/atomic:571:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/__threading_support:33:
In file included from foundation/distributeddatamgr/distributeddatamgr/services/distributeddataservice/libs/distributeddb/common/include/semaphore.h:21:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/mutex:190:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/__mutex_base:15:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/system_error:149:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/string:506:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/string_view:175:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/__string:57:
In file included from /mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/algorithm:644:
/mnt/80f149c9-ea3e-4b1a-a8ef-79e1121c4b3c/OpenHarmony/prebuilts/llvm-11.0.1/bin/../include/c++/v1/functional:1512:5: error: no template named '__compressed_pair'
__compressed_pair<_Fp, _Ap> _f;
memory:681 includes distributeddatamgr_datamgr's semaphore.h (through __threading_support) which tries to use __compressed_pair (through functional) defined after memory:681 (memory:2161).