<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - thread:370:65: error: operator '||' has no right operand"
   href="https://bugs.llvm.org/show_bug.cgi?id=46760">46760</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>thread:370:65: error: operator '||' has no right operand
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>libc++
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>10.0
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>Other
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>FreeBSD
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>normal
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>All Bugs
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>pkubaj@anongoth.pl
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, mclow.lists@gmail.com
          </td>
        </tr></table>
      <p>
        <div>
        <pre>FreeBSD head, powerpc64 elfv2, LLVM 10.0.1-rc2-0-g77d76b71d7d

When compiling software that includes thread, using GCC 10.1.0 and libc++, I'm
getting:
/usr/include/c++/v1/thread:370:65: error: operator '||' has no right operand
  370 | #if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)

The reason is that __POWERPC__ is undefined on FreeBSD. The proper way for this
ifdef would be:
Index: contrib/llvm-project/libcxx/include/thread
===================================================================
--- contrib/llvm-project/libcxx/include/thread  (revision 363109)
+++ contrib/llvm-project/libcxx/include/thread  (working copy)
@@ -367,7 +367,7 @@
     using namespace chrono;
     if (__d > duration<_Rep, _Period>::zero())
     {
-#if defined(_LIBCPP_COMPILER_GCC) && (__powerpc__ || __POWERPC__)
+#if defined(_LIBCPP_COMPILER_GCC) && (defined(__powerpc__) ||
defined(__POWERPC__))
     //  GCC's long double const folding is incomplete for IBM128 long doubles.
         _LIBCPP_CONSTEXPR duration<long double> _Max = nanoseconds::max();
 #else</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>