|
5014 | 5014 | Types
|
5015 | 5015 | \keyword{bool},
|
5016 | 5016 | \keyword{char}, \keyword{wchar_t},
|
5017 |
| -\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, |
5018 |
| -and the signed and unsigned integer types are |
5019 |
| -collectively called |
| 5017 | +\keyword{char8_t}, \keyword{char16_t}, \keyword{char32_t}, and |
| 5018 | +the signed and unsigned integer types, |
| 5019 | +and cv-qualified versions\iref{basic.type.qualifier} thereof, |
| 5020 | +are collectively termed |
5020 | 5021 | \defnx{integral types}{integral type}.
|
5021 | 5022 | A synonym for integral type is \defn{integer type}.
|
5022 | 5023 | \begin{note}
|
|
5027 | 5028 |
|
5028 | 5029 | \pnum
|
5029 | 5030 | \indextext{floating-point type|see{type, floating-point}}%
|
5030 |
| -There are three \defnx{floating-point types}{type!floating-point}: |
| 5031 | +The three distinct types |
5031 | 5032 | \indextext{type!\idxcode{float}}%
|
5032 | 5033 | \keyword{float},
|
5033 | 5034 | \indextext{type!\idxcode{double}}%
|
5034 | 5035 | \keyword{double},
|
5035 | 5036 | and
|
5036 | 5037 | \indextext{type!\idxcode{long double}}%
|
5037 |
| -\tcode{\keyword{long} \keyword{double}}. The type \keyword{double} provides at least as much |
| 5038 | +\tcode{\keyword{long} \keyword{double}} |
| 5039 | +can represent floating-point numbers. |
| 5040 | +The type \keyword{double} provides at least as much |
5038 | 5041 | precision as \keyword{float}, and the type \tcode{\keyword{long} \keyword{double}} provides at
|
5039 | 5042 | least as much precision as \keyword{double}. The set of values of the type
|
5040 | 5043 | \keyword{float} is a subset of the set of values of the type
|
5041 | 5044 | \keyword{double}; the set of values of the type \keyword{double} is a subset
|
5042 |
| -of the set of values of the type \tcode{\keyword{long} \keyword{double}}. The value |
| 5045 | +of the set of values of the type \tcode{\keyword{long} \keyword{double}}. |
| 5046 | +The types |
| 5047 | +\keyword{float}, \keyword{double}, and \tcode{\keyword{long} \keyword{double}}, |
| 5048 | +and cv-qualified versions\iref{basic.type.qualifier} thereof, |
| 5049 | +are collectively termed \defnx{floating-point types}{type!floating-point}. |
| 5050 | +The value |
5043 | 5051 | representation of floating-point types is \impldef{value representation of
|
5044 | 5052 | floating-point types}.
|
5045 | 5053 | \indextext{floating-point type!implementation-defined}%
|
|
5048 | 5056 | floating-point operations; see also~\ref{support.limits}.
|
5049 | 5057 | \end{note}
|
5050 | 5058 | Integral and floating-point types are collectively
|
5051 |
| -called \defnx{arithmetic}{type!arithmetic} types. |
| 5059 | +termed \defnx{arithmetic types}{type!arithmetic}. |
5052 | 5060 | \indextext{\idxcode{numeric_limits}!specializations for arithmetic types}%
|
5053 | 5061 | Specializations of the standard library template
|
5054 | 5062 | \tcode{std::numeric_limits}\iref{support.limits} shall specify the
|
|
5267 | 5275 | \indextext{cv-qualifier}%
|
5268 | 5276 | \indextext{\idxcode{const}}%
|
5269 | 5277 | \indextext{\idxcode{volatile}}%
|
5270 |
| -A type mentioned in~\ref{basic.fundamental} and~\ref{basic.compound} is |
5271 |
| -a \defnadj{cv-unqualified}{type}. Each type which is a |
5272 |
| -cv-unqualified object type or is |
5273 |
| -\keyword{void}\iref{basic.types} has three corresponding cv-qualified |
5274 |
| -versions of its type: a \defn{const-qualified} version, a |
5275 |
| -\defn{volatile-qualified} version, and a |
5276 |
| -\defn{const-volatile-qualified} version. The |
5277 |
| -type of an object\iref{intro.object} includes the \grammarterm{cv-qualifier}{s} |
5278 |
| -specified in the \grammarterm{decl-specifier-seq}\iref{dcl.spec}, |
5279 |
| -\grammarterm{declarator}\iref{dcl.decl}, |
5280 |
| -\grammarterm{type-id}\iref{dcl.name}, or |
5281 |
| -\grammarterm{new-type-id}\iref{expr.new} when the object is created. |
| 5278 | +Each type other than a function or reference type |
| 5279 | +is part of a group of four distinct, but related, types: |
| 5280 | +a \defn{cv-unqualified} version, |
| 5281 | +a \defn{const-qualified} version, |
| 5282 | +a \defn{volatile-qualified} version, and |
| 5283 | +a \defn{const-volatile-qualified} version. |
| 5284 | +The types in each such group shall have |
| 5285 | +the same representation and alignment requirements\iref{basic.align}. |
| 5286 | +\begin{footnote} |
| 5287 | +The same representation and alignment requirements |
| 5288 | +are meant to imply interchangeability as |
| 5289 | +arguments to functions, |
| 5290 | +return values from functions, and |
| 5291 | +non-static data members of unions. |
| 5292 | +\end{footnote} |
| 5293 | +A function or reference type is always cv-unqualified. |
5282 | 5294 | \begin{itemize}
|
5283 | 5295 | \item A \defnadj{const}{object} is an object of type \tcode{\keyword{const} T} or a
|
5284 | 5296 | non-mutable subobject of a const object.
|
|
5291 | 5303 | a const subobject of a volatile object, or a non-mutable volatile
|
5292 | 5304 | subobject of a const object.
|
5293 | 5305 | \end{itemize}
|
5294 |
| -The cv-qualified or |
5295 |
| -cv-unqualified versions of a type |
5296 |
| -are distinct types; however, they shall have the same representation and |
5297 |
| -alignment requirements\iref{basic.align}. |
5298 |
| -\begin{footnote} |
5299 |
| -The same representation |
5300 |
| -and alignment requirements are meant to imply |
5301 |
| -interchangeability as arguments to functions, return values from |
5302 |
| -functions, and non-static data members of unions. |
5303 |
| -\end{footnote} |
| 5306 | +\begin{note} |
| 5307 | +The type of an object\iref{intro.object} includes |
| 5308 | +the \grammarterm{cv-qualifier}s specified in the |
| 5309 | +\grammarterm{decl-specifier-seq}\iref{dcl.spec}, |
| 5310 | +\grammarterm{declarator}\iref{dcl.decl}, |
| 5311 | +\grammarterm{type-id}\iref{dcl.name}, or |
| 5312 | +\grammarterm{new-type-id}\iref{expr.new} |
| 5313 | +when the object is created. |
| 5314 | +\end{note} |
5304 | 5315 |
|
5305 | 5316 | \pnum
|
5306 | 5317 | Except for array types, a compound type\iref{basic.compound} is not cv-qualified by the
|
|
5663 | 5674 | \end{example}
|
5664 | 5675 |
|
5665 | 5676 | \pnum
|
5666 |
| -When calling a function (whether or not the function is inline), every |
5667 |
| -\indextext{value computation}% |
5668 |
| -value computation and |
5669 |
| -\indextext{side effects}% |
5670 |
| -side effect associated with any argument |
5671 |
| -expression, or with the postfix expression designating the called |
5672 |
| -function, is sequenced before execution of every expression or statement |
| 5677 | +When invoking a function (whether or not the function is inline), |
| 5678 | +every argument expression and |
| 5679 | +the postfix expression designating the called function |
| 5680 | +are sequenced before every expression or statement |
5673 | 5681 | in the body of the called function.
|
5674 |
| -For each function invocation \placeholder{F}, |
5675 |
| -for every evaluation \placeholder{A} that occurs within \placeholder{F} and |
5676 |
| -every evaluation \placeholder{B} that does not occur within \placeholder{F} but |
5677 |
| -is evaluated on the same thread and as part of the same signal handler (if any), |
5678 |
| -either \placeholder{A} is sequenced before \placeholder{B} or |
5679 |
| -\placeholder{B} is sequenced before \placeholder{A}. |
| 5682 | +For each function invocation or |
| 5683 | +evaluation of an \grammarterm{await-expression} \placeholder{F}, |
| 5684 | +each evaluation that does not occur within \placeholder{F} but |
| 5685 | +is evaluated on the same thread and as part of the same signal handler (if any) |
| 5686 | +is either sequenced before all evaluations that occur within \placeholder{F} |
| 5687 | +or sequenced after all evaluations that occur within \placeholder{F}; |
5680 | 5688 | \begin{footnote}
|
5681 | 5689 | In other words,
|
5682 | 5690 | function executions do not interleave with each other.
|
5683 | 5691 | \end{footnote}
|
5684 |
| -\begin{note} |
5685 |
| -If \placeholder{A} and \placeholder{B} would not otherwise be sequenced then they are |
5686 |
| -indeterminately sequenced. |
5687 |
| -\end{note} |
| 5692 | +if \placeholder{F} invokes or resumes a coroutine\iref{expr.await}, |
| 5693 | +only evaluations |
| 5694 | +subsequent to the previous suspension (if any) and |
| 5695 | +prior to the next suspension (if any) |
| 5696 | +are considered to occur within \placeholder{F}. |
| 5697 | + |
5688 | 5698 | Several contexts in \Cpp{} cause evaluation of a function call, even
|
5689 | 5699 | though no corresponding function call syntax appears in the translation
|
5690 | 5700 | unit.
|
|
6419 | 6429 | The linkage\iref{basic.link} of \tcode{main} is
|
6420 | 6430 | \impldef{linkage of \tcode{main}}. A program that defines \tcode{main} as
|
6421 | 6431 | deleted or that declares \tcode{main} to be
|
6422 |
| -\keyword{inline}, \keyword{static}, or \keyword{constexpr} is ill-formed. |
| 6432 | +\keyword{inline}, \keyword{static}, \keyword{constexpr}, or \keyword{consteval} is ill-formed. |
6423 | 6433 | The function \tcode{main} shall not be a coroutine\iref{dcl.fct.def.coroutine}.
|
6424 | 6434 | The \tcode{main} function shall not be declared with a
|
6425 | 6435 | \grammarterm{linkage-specification}\iref{dcl.link}.
|
|
0 commit comments