[libcxx-commits] [PATCH] D131732: [libcxx][NFC] utilises compiler builtins for unary transform type-traits

Jordan Rupprecht via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 25 22:08:23 PDT 2022


rupprecht added a comment.

The commit says NFC, but we found this to be an observable behavior change with `__restrict` now being dropped as part of `std::decay`: https://godbolt.org/z/zqvW478jq. It impacted us via use of `std::make_pair` which decays the types, and we had a `static_assert` checking that the type passed in had `__restrict` on it.

We have a workaround (just don't use `std::make_pair`), but I figured I should mention this since the commit is labelled NFC, so any observable change is a surprise.

IIUC, because `__restrict` is non-standard C++, it's implementation defined whether `std::decay` wants to modify it or not. Therefore, both before and after are "correct", and code should not rely on which option we choose.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131732



More information about the libcxx-commits mailing list