Created on 2022-05-10.00:00:00 last changed 30 months ago
Proposed resolution:
This wording is relative to N4910.
Modify [meta.type.synop], Table 46 ([tab:meta.unary.prop]) — "Type property predicates" — as indicated:
Table 46: Type property predicates [tab:meta.unary.prop] Template Condition Preconditions … template<class T, class U>
struct reference_constructs_from_temporary;conjunction_v<is_reference<T>, is_constructible<T, U>> is
true, and the initialization T t(VAL<U>); binds t to a
temporary object whose lifetime is extended ([class.temporary]).If T is a reference type, remove_reference_t<T>
and UTshall beacomplete types,
cv void, oranarrays of unknown bound.template<class T, class U>
struct reference_converts_from_temporary;conjunction_v<is_reference<T>, is_convertible<U, T>> is
true, and the initialization T t = VAL<U>; binds t to a
temporary object whose lifetime is extended ([class.temporary]).If T is a reference type, remove_reference_t<T>
and U shall be complete types,
cv void, or arrays of unknown bound.
[ 2022-05-17; Reflector poll ]
Set priority to 3 after reflector poll.
std::reference_constructs_from_temporary and std::reference_converts_from_temporary are only useful when T is a reference type, and a reference type is always complete. Whenever T is an incomplete object type, it's clear that these traits inherit from std::false_type, without any further detection which may result in UB. However, when T is X& or X&& where X is an incomplete object type, UB may be needed because of the potentially problematic detection in std::is_constructible or std::is_convertible.
I'm not sure whether the general rule in [meta.rqmts]/5 affects these cases.History | |||
---|---|---|---|
Date | User | Action | Args |
2022-05-17 11:58:16 | admin | set | messages: + msg12468 |
2022-05-14 11:41:32 | admin | set | messages: + msg12449 |
2022-05-10 00:00:00 | admin | create |