<html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;" class="">On Jul 29, 2020, at 5:32 AM, Oliver Major via libcxx-dev <<a href="mailto:libcxx-dev@lists.llvm.org" class="">libcxx-dev@lists.llvm.org</a>> wrote:<br class=""><div><blockquote type="cite" class=""><br class="Apple-interchange-newline"><div class=""><div dir="ltr" class="">Hello everyone,<div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">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.</div><div class=""><br class=""></div><div class="">What we did, was</div><div class=""><font face="monospace" class="">#define hash #</font></div><div class=""><br class=""></div><div class="">before</div><div class=""><font face="monospace" class="">#include <math.h></font></div><div class=""><br class=""></div><div class="">which let to a problem with libcxx/include/type_traits:417 <br class=""></div><div class=""><code class=""><span class="gmail-k">template</span> <span class="gmail-o"><</span><span class="gmail-k">class</span> <span class="gmail-nc">_Tp</span><span class="gmail-p">></span> <span class="gmail-k">struct</span> <span class="gmail-nc">_LIBCPP_TEMPLATE_VIS</span> <span class="gmail-n">hash</span><span class="gmail-p">;</span></code> <br class=""></div><div class=""><br class=""></div><div class="">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.</div></div></div></blockquote><div><br class=""></div>Good.</div><div><br class=""><blockquote type="cite" class=""><div class=""><div dir="ltr" class=""><div class=""><br class=""></div><div class="">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.</div></div></div></blockquote><br class=""></div><div>You’re not allowed to #define names that are defined in the standard library..</div><div>See <a href="http://eel.is/c++draft/macro.names" class="">http://eel.is/c++draft/macro.names</a>, which states:</div><div><br class=""></div><div>A translation unit that includes a standard library header shall not #define or #undef names declared in any standard library header.<br class=""><br class=""></div><div>— Marshall</div></body></html>