[llvm-bugs] [Bug 46760] New: thread:370:65: error: operator '||' has no right operand

via llvm-bugs llvm-bugs at lists.llvm.org
Fri Jul 17 02:34:34 PDT 2020


https://bugs.llvm.org/show_bug.cgi?id=46760

            Bug ID: 46760
           Summary: thread:370:65: error: operator '||' has no right
                    operand
           Product: libc++
           Version: 10.0
          Hardware: Other
                OS: FreeBSD
            Status: NEW
          Severity: normal
          Priority: P
         Component: All Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: pkubaj at anongoth.pl
                CC: llvm-bugs at lists.llvm.org, mclow.lists at gmail.com

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

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20200717/02c0962d/attachment.html>


More information about the llvm-bugs mailing list