Adjust valptridx for clang static_assert limitation

valptridx contains `static_assert` statements of the form:

	static_assert(var.m, "");

where `var` is a non-`constexpr` reference and `m` is a `static
constexpr` member of a base type of `var`.  gcc recognizes that a
`static constexpr` member is a constant expression and permits this.
clang rejects this, presumably because `var` is not a `constexpr`
variable.  In the almost 3 years since this was added, clang has not
improved to permit this usage.  Rather than continuing to suppress
static_assert in clang, rewrite this expression to be less clear, but be
compatible with clang.
This commit is contained in:
Kp 2018-05-05 22:33:55 +00:00
parent d269c878b3
commit 23a899cf0e

View file

@ -353,7 +353,7 @@ public:
* right hand side must be saved and checked for validity before
* being used to initialize a require_valid type.
*/
static_assert(allow_nullptr || !rhs.allow_nullptr, "cannot move from allow_invalid to require_valid");
static_assert(policy::allow_nullptr || !rpolicy::allow_nullptr, "cannot move from allow_invalid to require_valid");
}
idx(index_type i DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_L_DECL_VARS) :
m_idx(check_allowed_invalid_index(i) ? i : check_index_range<index_range_error_type<array_managed_type>>(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_PASS_VARS i, nullptr))
@ -489,7 +489,7 @@ public:
* right hand side must be saved and checked for validity before
* being used to initialize a require_valid type.
*/
static_assert(allow_nullptr || !rhs.allow_nullptr, "cannot move from allow_invalid to require_valid");
static_assert(policy::allow_nullptr || !rpolicy::allow_nullptr, "cannot move from allow_invalid to require_valid");
}
ptr(index_type i) = delete;
ptr(DXX_VALPTRIDX_REPORT_STANDARD_LEADER_COMMA_R_DEFN_VARS index_type i, array_managed_type &a) :