|
826 | 826 |
|
827 | 827 | \pnum
|
828 | 828 | \indextext{promotion!integral}%
|
829 |
| -A prvalue of an integer type other than \keyword{bool}, \keyword{char16_t}, |
| 829 | +A prvalue of an integer type other than \keyword{bool}, \keyword{char8_t}, \keyword{char16_t}, |
830 | 830 | \keyword{char32_t}, or \keyword{wchar_t} whose integer conversion
|
831 | 831 | rank\iref{conv.rank} is less than the rank of \keyword{int} can be
|
832 | 832 | converted to a prvalue of type \keyword{int} if \keyword{int} can represent
|
|
837 | 837 | \indextext{type!underlying!\idxcode{wchar_t}}%
|
838 | 838 | \indextext{type!underlying!\idxcode{char16_t}}%
|
839 | 839 | \indextext{type!underlying!\idxcode{char32_t}}%
|
840 |
| -A prvalue of type \keyword{char16_t}, \keyword{char32_t}, or |
| 840 | +A prvalue of type \keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or |
841 | 841 | \keyword{wchar_t}\iref{basic.fundamental} can be converted to a prvalue
|
842 | 842 | of the first of the following types that can represent all the values of
|
843 | 843 | its underlying type: \keyword{int}, \tcode{\keyword{unsigned} \keyword{int}}, \tcode{\keyword{long} \keyword{int}},
|
844 | 844 | \tcode{\keyword{unsigned} \keyword{long} \keyword{int}}, \tcode{\keyword{long} \keyword{long} \keyword{int}},
|
845 | 845 | or \tcode{\keyword{unsigned} \keyword{long} \keyword{long} \keyword{int}}. If none of the types in that list can
|
846 | 846 | represent all the values of its underlying type, a prvalue of type
|
847 |
| -\keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted |
| 847 | +\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, or \keyword{wchar_t} can be converted |
848 | 848 | to a prvalue of its underlying type.
|
849 | 849 |
|
850 | 850 | \pnum
|
|
2440 | 2440 | \tcode{m1}, then
|
2441 | 2441 | \tcode{m2}'s capture is transformed as follows:
|
2442 | 2442 | \begin{itemize}
|
2443 |
| -\item if \tcode{m1} captures the entity by copy, |
| 2443 | +\item If \tcode{m1} captures the entity by copy, |
2444 | 2444 | \tcode{m2} captures the corresponding
|
2445 | 2445 | non-static data member of \tcode{m1}'s closure type;
|
2446 |
| -\item if \tcode{m1} captures the entity by reference, |
| 2446 | +if \tcode{m1} is not mutable, the non-static data member is considered to be const-qualified. |
| 2447 | +\item If \tcode{m1} captures the entity by reference, |
2447 | 2448 | \tcode{m2} captures the same
|
2448 | 2449 | entity captured by \tcode{m1}.
|
2449 | 2450 | \end{itemize}
|
|
3062 | 3063 |
|
3063 | 3064 | \pnum
|
3064 | 3065 | Calling a function through an
|
3065 |
| -expression whose function type is different |
3066 |
| -from the function type of the called function's |
3067 |
| -definition results in undefined behavior. |
| 3066 | +expression whose function type \tcode{E} is different |
| 3067 | +from the function type \tcode{F} of the called function's |
| 3068 | +definition results in undefined behavior |
| 3069 | +unless the type ``pointer to \tcode{F}'' can be converted |
| 3070 | +to the type ``pointer to \tcode{E}'' via a function pointer conversion\iref{conv.fctptr}. |
| 3071 | +\begin{note} |
| 3072 | +The exception applies when the expression has the type of a |
| 3073 | +potentially-throwing function, but the called function has |
| 3074 | +a non-throwing exception specification, |
| 3075 | +and the function types are otherwise the same. |
| 3076 | +\end{note} |
3068 | 3077 |
|
3069 | 3078 | \pnum
|
3070 | 3079 | \indextext{function argument|see{argument}}%
|
|
7207 | 7216 | that refers to a non-volatile object
|
7208 | 7217 | whose lifetime began within the evaluation of $E$;
|
7209 | 7218 |
|
| 7219 | +\item |
| 7220 | +an invocation of a destructor\iref{class.dtor} or a function call |
| 7221 | +whose \grammarterm{postfix-expression} names a pseudo-destructor\iref{expr.call}, |
| 7222 | +in either case for an object whose lifetime did not begin within the evaluation of $E$; |
| 7223 | + |
7210 | 7224 | \item
|
7211 | 7225 | a \grammarterm{new-expression}\iref{expr.new},
|
7212 | 7226 | unless the selected allocation function is
|
|
7310 | 7324 | even if the actual evaluation of such a call
|
7311 | 7325 | would otherwise fail the requirements for a core constant expression.
|
7312 | 7326 | Similarly, the evaluation of a call to
|
7313 |
| -\tcode{std::destroy_at}, |
7314 |
| -\tcode{std::ranges::destroy_at}, |
7315 |
| -\tcode{std::construct_at}, or |
7316 |
| -\tcode{std::ranges::construct_at} |
| 7327 | +\tcode{std::construct_at} or \tcode{std::ranges::construct_at} |
7317 | 7328 | does not disqualify $E$
|
7318 |
| -from being a core constant expression unless: |
7319 |
| -\begin{itemize} |
7320 |
| -\item |
7321 |
| - for a call to \tcode{std::construct_at} or \tcode{std::ranges::construct_at}, |
7322 |
| - the first argument, of type \tcode{T*}, |
7323 |
| - does not point |
7324 |
| - to storage allocated with \tcode{std::allocator<T>} or |
7325 |
| - to an object whose lifetime began within the evaluation of $E$, or |
7326 |
| - the evaluation of the underlying constructor call |
7327 |
| - disqualifies $E$ from being a core constant expression, or |
7328 |
| -\item |
7329 |
| - for a call to \tcode{std::destroy_at} or \tcode{std::ranges::destroy_at}, |
7330 |
| - the first argument, of type \tcode{T*}, |
7331 |
| - does not point |
7332 |
| - to storage allocated with \tcode{std::allocator<T>} or |
7333 |
| - to an object whose lifetime began within the evaluation of $E$, or |
7334 |
| - the evaluation of the underlying destructor call |
7335 |
| - disqualifies $E$ from being a core constant expression. |
7336 |
| -\end{itemize} |
| 7329 | +from being a core constant expression unless |
| 7330 | +the first argument, of type \tcode{T*}, does not point |
| 7331 | +to storage allocated with \tcode{std::allocator<T>} or |
| 7332 | +to an object whose lifetime began within the evaluation of $E$, or |
| 7333 | +the evaluation of the underlying constructor call |
| 7334 | +disqualifies $E$ from being a core constant expression. |
7337 | 7335 |
|
7338 | 7336 | \pnum
|
7339 | 7337 | An object \tcode{a} is said to have \defnadj{constant}{destruction} if:
|
|
0 commit comments