Skip to content

thread:370:65: error: operator '||' has no right operand #46105

@pkubaj

Description

@pkubaj
Bugzilla Link 46760
Resolution FIXED
Resolved on Sep 20, 2021 13:17
Version 10.0
OS FreeBSD
Blocks #44654
CC @ldionne,@mclow
Fixed by commit(s) 9f4022f

Extended Description

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 _Max = nanoseconds::max();
#else

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugzillaIssues migrated from bugzillalibc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions