Skip to content

[conv.rank] Move from [conv] to [basic.types] #1802

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 12, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
56 changes: 56 additions & 0 deletions source/basic.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
55 changes: 0 additions & 55 deletions source/conversions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -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|)}