[libc-commits] [libc] [libc] Disable hidden visibility for LIBC_NAMESPACE with GCC (PR #98549)

Michael Jones via libc-commits libc-commits at lists.llvm.org
Thu Jul 11 14:06:21 PDT 2024


michaelrj-google wrote:

> What is the warning? This should work in C++17 as far as I know https://godbolt.org/z/j94hxsTGa.

>From the buildbot:

```
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h: In instantiation of ‘constexpr __llvm_libc_19_0_0_git::cpp::array<word, N> __llvm_libc_19_0_0_git::multiword::shift(__llvm_libc_19_0_0_git::cpp::array<word, N>, size_t) [with Direction direction = __llvm_libc_19_0_0_git::multiword::RIGHT; bool is_signed = false; word = long unsigned int; long unsigned int N = 5; size_t = long unsigned int]’:
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:760:61:   required from ‘constexpr __llvm_libc_19_0_0_git::BigInt<Bits, Signed, WordType> __llvm_libc_19_0_0_git::BigInt<Bits, Signed, WordType>::operator>>(size_t) const [with long unsigned int Bits = 320; bool Signed = false; WordType = long unsigned int; size_t = long unsigned int]’
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/float_to_string.h:390:29:   required from here
/home/llvm-libc-buildbot/buildbot-worker/libc-x86_64-debian-fullbuild/libc-x86_64-debian-gcc-fullbuild-dbg/llvm-project/libc/src/__support/big_int.h:281:28: error: ‘__llvm_libc_19_0_0_git::multiword::shift<__llvm_libc_19_0_0_git::multiword::RIGHT, false, long unsigned int, 5>(__llvm_libc_19_0_0_git::cpp::array<long unsigned int, 5>, size_t)::<lambda(size_t)>’ declared with greater visibility than the type of its field ‘__llvm_libc_19_0_0_git::multiword::shift<__llvm_libc_19_0_0_git::multiword::RIGHT, false, long unsigned int, 5>(__llvm_libc_19_0_0_git::cpp::array<long unsigned int, 5>, size_t)::<lambda(size_t)>::<array capture>’ [-Werror=attributes]
  281 |   const auto safe_get_at = [&](size_t index) -> word {
      |                            ^~~~~~~~~~~~~~~~~~~~~~~~~~~
  282 |     // return appropriate value when accessing out of bound elements.
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  283 |     const int i = at(index);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~
  284 |     if (i < 0)
      |     ~~~~~~~~~~              
  285 |       return 0;
      |       ~~~~~~~~~             
  286 |     if (i >= int(N))
      |     ~~~~~~~~~~~~~~~~        
  287 |       return is_neg ? -1 : 0;
      |       ~~~~~~~~~~~~~~~~~~~~~~~
  288 |     return array[i];
      |     ~~~~~~~~~~~~~~~~        
  289 |   };
      |   ~                         
```

https://github.com/llvm/llvm-project/pull/98549


More information about the libc-commits mailing list