[libcxx-commits] [PATCH] D84200: Disable trivial weak_ptr test on ARM because it is not expected to work.

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Jul 21 07:56:14 PDT 2020


ldionne added a comment.

In D84200#2164275 <https://reviews.llvm.org/D84200#2164275>, @oontvoo wrote:

> In D84200#2164127 <https://reviews.llvm.org/D84200#2164127>, @ldionne wrote:
>
> > In that case, shouldn't it be an error to try to make `weak_ptr` trivial on ARM? The current state of things appears to be that one will say "make `weak_ptr` trivial", and the library will silently fail to honour that request.
>
>
> An error by the compiler? IIUC, the attribute is a "request". It can try to honour it but doesn't have to if it can't. (probably similar to how `inline` and a few other directives are treated)
>
> Or are you suggesting we detect this in the __config and `#error` (or `#warn` )? Is it customary for libraries in libcxx to do that?


My point is that someone compiling for ARM will define `_LIBCPP_ABI_ENABLE_SHARED_PTR_TRIVIAL_ABI` thinking they are getting trivial `weak_ptr` and `shared_ptr` passed in registers, but they won't (and silently so). That deception is what I think should be flagged explicitly through an error of some sort. Do you agree?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D84200





More information about the libcxx-commits mailing list