[libcxx-commits] [PATCH] D65034: [libc++] use constexpr for sizeof comparisons

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Wed Mar 25 10:16:08 PDT 2020


ldionne added a comment.

In D65034#1941567 <https://reviews.llvm.org/D65034#1941567>, @asomers wrote:

> In D65034#1941477 <https://reviews.llvm.org/D65034#1941477>, @ldionne wrote:
>
> > Looking at this again and the corresponding GCC bug report, I think we should either:
> >
> > - not fix this issue -- this warning shouldn't bubble up since we mark our headers as system headers, or
> > - disable `-Wplacement-new` around that code with a `#pragma`, and reference the GCC bug in a comment.
>
>
> Well, the warning does bubble up.  I ran into this when using GCC to build FreeBSD for riscv64.


Can you show me how you're building the file that produces a warning? Normally, our headers shouldn't bubble up warnings cause we use the `#pragma system header` on GCC. If that doesn't work, then either their warning doesn't listen to the pragma, or something else is happening. Either way, I'd like to understand before we change any code.

> And while we could just disable that warning, that doesn't feel right, because the GCC people don't consider this a bug at all.

I agree that turning the warning off completely isn't the solution.

> They say "if constexpr is of course the right solution here, for certain".

On the Bug report, the GCC folks don't say that, Matt Godbolt does. The GCC developer (Martin Sebor IIUC) says that the warning isn't smart enough at the moment, which is indeed what it looks to me.


Repository:
  rCXX libc++

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

https://reviews.llvm.org/D65034





More information about the libcxx-commits mailing list