[libcxx-dev] LLVM libcxx "hash" clashes with custom define "hash"

Oliver Major via libcxx-dev libcxx-dev at lists.llvm.org
Wed Jul 29 05:32:48 PDT 2020


Hello everyone,

I am new here and in fact not subscribed, I just have a question and don't
even know if I am at the right address.

We recently found a bug in our product code when building with NDK Clang
for Android and it is related to the LLVM libcxx. It is fairly easy to
reproduce and a quick internet search reveals that we are not the only ones
with this or a similar issue.

What we did, was
#define hash #

before
#include <math.h>

which let to a problem with libcxx/include/type_traits:417
template <class _Tp> struct _LIBCPP_TEMPLATE_VIS hash;

of course. We obviously shouldn't let defines leak into the stdlib, so it
is our fault, we fixed it simply by renaming the define.

I didn't want to post it as a bug in the LLVM bugtracker, because I don't
even think it needs fixing on LLVM side. I just wanted to make aware that
this issue exists for some people and wanted to ask if there is a way to
publicly document this issue somewhere, so people having problems with this
can potentially find a solution on the internet.

Best regards,
O. Major
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/libcxx-dev/attachments/20200729/f8a1d862/attachment.html>


More information about the libcxx-dev mailing list