Commit 26fffc1b authored by Arthur O'Dwyer's avatar Arthur O'Dwyer
Browse files

[libc++] [test] {cpo,niebloid}.compile.pass.cpp: Also test their constness.

This will detect if someone writes `inline auto cpo =` instead of
`inline constexpr auto cpo =`. I don't know how that'd be possible,
but it's easy to test, so let's test it.
parent 5f2854f1
......@@ -13,13 +13,16 @@
// [range.adaptor.object] "A range adaptor object is a customization point object..."
#include <compare>
#include <concepts>
#include <iterator>
#include <ranges>
#include <type_traits>
#include <utility>
// Test for basic properties of C++20 16.3.3.3.6 [customization.point.object].
template <class CPO, class... Args>
constexpr bool test(CPO& o, Args&&...) {
static_assert(std::is_const_v<CPO>);
static_assert(std::is_class_v<CPO>);
static_assert(std::is_trivial_v<CPO>);
......
......@@ -32,6 +32,7 @@
template <class CPO, class... Args>
constexpr bool test(CPO& o, Args&&...) {
static_assert(std::is_const_v<CPO>);
static_assert(std::is_class_v<CPO>);
static_assert(std::is_trivial_v<CPO>);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment