[libcxx-commits] [PATCH] D88131: adds [concepts.arithmetic]
Michael Schellenberger Costa via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Wed Sep 23 00:48:38 PDT 2020
miscco added a comment.
Some small nits
================
Comment at: libcxx/test/std/concepts/lang/arithmetic.pass.cpp:29
+constexpr void CheckIntegral() {
+ // conventional integral types
+ static_assert(std::integral<signed char>);
----------------
cjdb wrote:
> This formatting feels off but it's what `git clang-format-12 HEAD~1` gave me. Can someone please confirm this is the correct style?
I believe that there is no libc++ code style yet, @ldionne what are the chances of defining one?
================
Comment at: libcxx/test/std/concepts/lang/arithmetic.pass.cpp:30
+ // conventional integral types
+ static_assert(std::integral<signed char>);
+ static_assert(std::integral<unsigned char>);
----------------
Would it simplify the testing when we had a function like this
```cpp
template <typename T, bool Expected>
constexpr void CheckQualifiers() {
static_assert(std::integral<T> == Expected);
static_assert(std::integral<const T> == Expected);
static_assert(std::integral<volatile T> == Expected);
static_assert(std::integral<const volatile T> == Expected);
static_assert(!std::integral<T&>);
static_assert(!std::integral<const T&>);
static_assert(!std::integral<volatile T&>);
static_assert(!std::integral<const volatile T&>);
static_assert(!std::integral<T*>);
static_assert(!std::integral<const T*>);
static_assert(!std::integral<volatile T*>);
static_assert(!std::integral<const volatile T*>);
}
```
================
Comment at: libcxx/test/std/concepts/lang/arithmetic.pass.cpp:44
+
+ // integrals that mightn't necessarily be expected as integral
+ static_assert(std::integral<wchar_t>);
----------------
I believe this counts as extended integer types?
Repository:
rCXX libc++
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D88131/new/
https://reviews.llvm.org/D88131
More information about the libcxx-commits
mailing list