[libc-commits] [PATCH] D142921: [libc] Fix reusing/redefining `FPBits` symbols.

Tue Ly via Phabricator via libc-commits libc-commits at lists.llvm.org
Wed Feb 1 08:02:57 PST 2023


lntue added a comment.

In D142921#4095557 <https://reviews.llvm.org/D142921#4095557>, @sivachandra wrote:

> I think the best understanding of the problem comes from these two links:
>
> clang allows it: https://godbolt.org/z/z5rWhzKET
> gcc complains: https://godbolt.org/z/T6dvxTWKv
>
> GCC's error message is actually very suggestive. IIUC, it is saying that we are changing the meaning of the type named `S` within the scope of the `U` (it is easy to see the problem if `U` were the global namespace). I think the older version of the code linked to in the bug had this problem: https://github.com/llvm/llvm-project/blob/d883a4ad02d867e7037bd4ec342016c402484148/libc/src/__support/FPUtil/except_value_utils.h
>
> IMHO, it is very subtle. The problem code redefined the type names within the namespace `__llvm_libc::fputil`. But, I think the current code does not have any such instances - the renames are happening in the namespace `__llvm_libc`. So, my guess is that that is why we are not seeing similar errors with GCC anymore. Considering that we do have a GCC bot, do we really want to "fix"?

I think you're right!  As long as the gcc bot is not complaining, this patch is not needed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D142921/new/

https://reviews.llvm.org/D142921



More information about the libc-commits mailing list