diff --git a/source/basic.tex b/source/basic.tex index ad7573b9dc..5315542c9a 100644 --- a/source/basic.tex +++ b/source/basic.tex @@ -4155,6 +4155,62 @@ \end{example}% \indextext{type|)} +\rSec2[conv.rank]{Integer conversion rank}% +\indextext{conversion!integer rank} + +\pnum +Every integer type has an \term{integer conversion rank} defined as follows: + +\begin{itemize} +\item No two signed integer types other than \tcode{char} and \tcode{signed +char} (if \tcode{char} is signed) shall have the same rank, even if they have +the same representation. + +\item The rank of a signed integer type shall be greater than the rank +of any signed integer type with a smaller size. + +\item The rank of \tcode{long long int} shall be greater +than the rank of \tcode{long int}, which shall be greater than +the rank of \tcode{int}, which shall be greater than the rank of +\tcode{short int}, which shall be greater than the rank of +\tcode{signed char}. + +\item The rank of any unsigned integer type shall equal the rank of the +corresponding signed integer type. + +\item The rank of any standard integer type shall be greater than the +rank of any extended integer type with the same size. + +\item The rank of \tcode{char} shall equal the rank of \tcode{signed char} +and \tcode{unsigned char}. + +\item The rank of \tcode{bool} shall be less than the rank of all other +standard integer types. + +\indextext{type!\idxcode{wchar_t}}% +\indextext{type!\idxcode{char16_t}}% +\indextext{type!\idxcode{char32_t}}% +\item The ranks of \tcode{char16_t}, \tcode{char32_t}, and +\tcode{wchar_t} shall equal the ranks of their underlying +types\iref{basic.fundamental}. + +\item The rank of any extended signed integer type relative to another +extended signed integer type with the same size is \impldef{rank of extended signed +integer type}, but still subject to the other rules for determining the integer +conversion rank. + +\item For all integer types \tcode{T1}, \tcode{T2}, and \tcode{T3}, if +\tcode{T1} has greater rank than \tcode{T2} and \tcode{T2} has greater +rank than \tcode{T3}, then \tcode{T1} shall have greater rank than +\tcode{T3}. +\end{itemize} + +\begin{note} +The integer conversion rank is used in the definition of the integral +promotions\iref{conv.prom} and the usual arithmetic +conversions\iref{expr.prop}. +\end{note}% + \rSec1[basic.exec]{Program execution} \rSec2[intro.execution]{Sequential execution} diff --git a/source/conversions.tex b/source/conversions.tex index af6ea868c8..fb97829c13 100644 --- a/source/conversions.tex +++ b/source/conversions.tex @@ -608,59 +608,4 @@ \tcode{std::nullptr_t} can be converted to a prvalue of type \tcode{bool}; the resulting value is \tcode{false}. -\rSec1[conv.rank]{Integer conversion rank}% -\indextext{conversion!integer rank} - -\pnum -Every integer type has an \term{integer conversion rank} defined as follows: - -\begin{itemize} -\item No two signed integer types other than \tcode{char} and \tcode{signed -char} (if \tcode{char} is signed) shall have the same rank, even if they have -the same representation. - -\item The rank of a signed integer type shall be greater than the rank -of any signed integer type with a smaller size. - -\item The rank of \tcode{long long int} shall be greater -than the rank of \tcode{long int}, which shall be greater than -the rank of \tcode{int}, which shall be greater than the rank of -\tcode{short int}, which shall be greater than the rank of -\tcode{signed char}. - -\item The rank of any unsigned integer type shall equal the rank of the -corresponding signed integer type. - -\item The rank of any standard integer type shall be greater than the -rank of any extended integer type with the same size. - -\item The rank of \tcode{char} shall equal the rank of \tcode{signed char} -and \tcode{unsigned char}. - -\item The rank of \tcode{bool} shall be less than the rank of all other -standard integer types. - -\indextext{type!\idxcode{wchar_t}}% -\indextext{type!\idxcode{char16_t}}% -\indextext{type!\idxcode{char32_t}}% -\item The ranks of \tcode{char16_t}, \tcode{char32_t}, and -\tcode{wchar_t} shall equal the ranks of their underlying -types\iref{basic.fundamental}. - -\item The rank of any extended signed integer type relative to another -extended signed integer type with the same size is \impldef{rank of extended signed -integer type}, but still subject to the other rules for determining the integer -conversion rank. - -\item For all integer types \tcode{T1}, \tcode{T2}, and \tcode{T3}, if -\tcode{T1} has greater rank than \tcode{T2} and \tcode{T2} has greater -rank than \tcode{T3}, then \tcode{T1} shall have greater rank than -\tcode{T3}. -\end{itemize} - -\begin{note} -The integer conversion rank is used in the definition of the integral -promotions\iref{conv.prom} and the usual arithmetic -conversions\iref{expr.prop}. -\end{note}% \indextext{conversion!standard|)}