|
2323 | 2323 | \pnum
|
2324 | 2324 | The ambiguity arising from the similarity between a function-style cast and
|
2325 | 2325 | a declaration mentioned in~\ref{stmt.ambig} can also occur in the context of a declaration.
|
2326 |
| -In that context, the choice is between a function declaration with |
2327 |
| -a redundant set of parentheses around a parameter name and an object declaration |
2328 |
| -with a function-style cast as the initializer. |
| 2326 | +In that context, the choice is between |
| 2327 | +an object declaration |
| 2328 | +with a function-style cast as the initializer and |
| 2329 | +a declaration involving a function declarator |
| 2330 | +with a redundant set of parentheses around a parameter name. |
2329 | 2331 | Just as for the ambiguities mentioned in~\ref{stmt.ambig},
|
2330 |
| -the resolution is to consider any construct that could possibly |
2331 |
| -be a declaration a declaration. |
| 2332 | +the resolution is to consider any construct, |
| 2333 | +such as the potential parameter declaration, |
| 2334 | +that could possibly be a declaration |
| 2335 | +to be a declaration. |
2332 | 2336 | \begin{note}
|
2333 | 2337 | A declaration can be explicitly disambiguated by adding parentheses
|
2334 | 2338 | around the argument.
|
|
4455 | 4459 | as well as in argument passing, function return,
|
4456 | 4460 | throwing an exception\iref{except.throw},
|
4457 | 4461 | handling an exception\iref{except.handle},
|
4458 |
| -and aggregate member initialization\iref{dcl.init.aggr}, |
| 4462 | +and aggregate member initialization other than by a |
| 4463 | +\grammarterm{designated-initializer-clause}\iref{dcl.init.aggr}, |
4459 | 4464 | is called
|
4460 | 4465 | \defn{copy-initialization}.
|
4461 | 4466 | \begin{note}
|
|
4548 | 4553 | is the same class as the class of the destination,
|
4549 | 4554 | the initializer expression is used to initialize the destination object.
|
4550 | 4555 | \begin{example}
|
4551 |
| -\tcode{T x = T(T(T()));} calls the \tcode{T} default constructor to initialize \tcode{x}. |
| 4556 | +\tcode{T x = T(T(T()));} value-initializes \tcode{x}. |
4552 | 4557 | \end{example}
|
4553 | 4558 | \item
|
4554 | 4559 | Otherwise, if the initialization is direct-initialization,
|
|
4680 | 4685 | An \grammarterm{initializer-clause} followed by an ellipsis is a
|
4681 | 4686 | pack expansion\iref{temp.variadic}.
|
4682 | 4687 |
|
| 4688 | +\pnum |
| 4689 | +Initialization includes |
| 4690 | +the evaluation of all subexpressions of |
| 4691 | +each \grammarterm{initializer-clause} of |
| 4692 | +the initializer (possibly nested within \grammarterm{braced-init-list}{s}) and |
| 4693 | +the creation of any temporary objects for |
| 4694 | +function arguments or return values\iref{class.temporary}. |
| 4695 | + |
4683 | 4696 | \pnum
|
4684 | 4697 | If the initializer is a parenthesized \grammarterm{expression-list},
|
4685 | 4698 | the expressions are evaluated in the order
|
|
4736 | 4749 | \item
|
4737 | 4750 | no private or protected direct non-static data members\iref{class.access},
|
4738 | 4751 | \item
|
4739 |
| -no virtual functions\iref{class.virtual}, and |
| 4752 | +no private or protected direct base classes\iref{class.access.base}, and |
4740 | 4753 | \item
|
4741 |
| -no virtual, private, or protected base classes\iref{class.mi}. |
| 4754 | +no virtual functions\iref{class.virtual} or virtual base classes\iref{class.mi}. |
4742 | 4755 | \end{itemize}
|
4743 | 4756 | \begin{note}
|
4744 | 4757 | Aggregate initialization does not allow accessing
|
|
4790 | 4803 | the initializer list is
|
4791 | 4804 | a brace-enclosed \grammarterm{designated-initializer-list},
|
4792 | 4805 | the element is initialized by the
|
4793 |
| -\grammarterm{designated-initializer-list} \tcode{\{ }\placeholder{D}\tcode{ \}}, |
| 4806 | +\grammarterm{braced-init-list} \tcode{\{ }\placeholder{D}\tcode{ \}}, |
4794 | 4807 | where \placeholder{D} is the \grammarterm{designated-initializer-clause}
|
4795 | 4808 | naming a member of the anonymous union member.
|
4796 | 4809 | There shall be only one such \grammarterm{designated-initializer-clause}.
|
|
4818 | 4831 | a narrowing conversion\iref{dcl.init.list} is required
|
4819 | 4832 | to convert the expression, the program is ill-formed.
|
4820 | 4833 | \begin{note}
|
| 4834 | +If the initialization is by \grammarterm{designated-initializer-clause}, |
| 4835 | +its form determines whether copy-initialization or direct-initialization |
| 4836 | +is performed. |
| 4837 | +\end{note} |
| 4838 | +\begin{note} |
4821 | 4839 | If an initializer is itself an initializer list,
|
4822 | 4840 | the element is list-initialized, which will result in a recursive application
|
4823 | 4841 | of the rules in this subclause if the element is an aggregate.
|
|
5975 | 5993 | original type, or
|
5976 | 5994 |
|
5977 | 5995 | \item from an integer type or unscoped enumeration type to an integer type that cannot
|
5978 |
| -represent all the values of the original type, except where the source is a constant |
| 5996 | +represent all the values of the original type, except where |
| 5997 | +\begin{itemize} |
| 5998 | +\item |
| 5999 | +the source is a bit-field whose width $w$ is less than that of its type |
| 6000 | +(or, for an enumeration type, its underlying type) and |
| 6001 | +the target type can represent all the values |
| 6002 | +of a hypothetical extended integer type |
| 6003 | +with width $w$ and with the same signedness as the original type or |
| 6004 | +\item |
| 6005 | +the source is a constant |
5979 | 6006 | expression whose value after integral promotions will fit into the target type, or
|
| 6007 | +\end{itemize} |
5980 | 6008 |
|
5981 | 6009 | \item from a pointer type or a pointer-to-member type to \tcode{bool}.
|
5982 | 6010 | \end{itemize}
|
|
6448 | 6476 | where
|
6449 | 6477 | \begin{itemize}
|
6450 | 6478 | \item
|
| 6479 | +\indextext{coroutine!await expression}% |
6451 | 6480 | the \grammarterm{await-expression} containing
|
6452 | 6481 | the call to \tcode{initial_suspend}
|
6453 |
| -is the \defn{initial suspend point}, and |
| 6482 | +is the \defnadj{initial}{await expression}, and |
6454 | 6483 | \item
|
6455 | 6484 | the \grammarterm{await-expression} containing
|
6456 | 6485 | the call to \tcode{final_suspend}
|
6457 |
| -is the \defn{final suspend point}, and |
| 6486 | +is the \defnadj{final}{await expression}, and |
6458 | 6487 | \item
|
6459 | 6488 | \placeholder{initial-await-resume-called}
|
6460 | 6489 | is initially \tcode{false} and is set to \tcode{true}
|
6461 | 6490 | immediately before the evaluation
|
6462 | 6491 | of the \placeholder{await-resume} expression\iref{expr.await}
|
6463 |
| -of the initial suspend point, and |
| 6492 | +of the initial await expression, and |
6464 | 6493 | \item
|
6465 | 6494 | \placeholder{promise-type} denotes the promise type, and
|
6466 | 6495 | \item
|
|
6476 | 6505 | constructor is found\iref{over.match.viable}, then
|
6477 | 6506 | \placeholder{promise-constructor-arguments} is
|
6478 | 6507 | \tcode{($\tcode{q}_1$, $\dotsc$, $\tcode{q}_n$)}, otherwise
|
6479 |
| -\placeholder{promise-constructor-arguments} is empty. |
| 6508 | +\placeholder{promise-constructor-arguments} is empty, and |
| 6509 | +\item |
| 6510 | +a coroutine is suspended at the \defnadj{initial}{suspend point} if |
| 6511 | +it is suspended at the initial await expression, and |
| 6512 | +\item |
| 6513 | +a coroutine is suspended at a \defnadj{final}{suspend point} if |
| 6514 | +it is suspended |
| 6515 | +\begin{itemize} |
| 6516 | +\item |
| 6517 | +at a final await expression or |
| 6518 | +\item |
| 6519 | +due to an exception exiting from \tcode{unhandled_exception()}. |
| 6520 | +\end{itemize} |
6480 | 6521 | \end{itemize}
|
6481 | 6522 |
|
6482 | 6523 | \pnum
|
|
6504 | 6545 | a resumption member function\iref{coroutine.handle.resumption}
|
6505 | 6546 | of a coroutine handle\iref{coroutine.handle}
|
6506 | 6547 | that refers to the coroutine.
|
6507 |
| -The function that invoked a resumption member function is |
| 6548 | +The evaluation that invoked a resumption member function is |
6508 | 6549 | called the \defnx{resumer}{coroutine!resumer}.
|
6509 | 6550 | Invoking a resumption member function for a coroutine
|
6510 | 6551 | that is not suspended results in undefined behavior.
|
|
6642 | 6683 | \pnum
|
6643 | 6684 | If the evaluation of the expression
|
6644 | 6685 | \tcode{\exposid{promise}.unhandled_exception()} exits via an exception,
|
6645 |
| -the coroutine is considered suspended at the final suspend point. |
| 6686 | +the coroutine is considered suspended at the final suspend point |
| 6687 | +and the exception propagates to the caller or resumer. |
6646 | 6688 |
|
6647 | 6689 | \pnum
|
6648 | 6690 | The expression \keyword{co_await} \tcode{\exposid{promise}.final_suspend()}
|
|
7027 | 7069 | this range.
|
7028 | 7070 | \end{footnote}
|
7029 | 7071 |
|
| 7072 | +\pnum |
| 7073 | +An enumeration has |
| 7074 | +the same size, |
| 7075 | +value representation, and |
| 7076 | +alignment requirements\iref{basic.align} |
| 7077 | +as its underlying type. |
| 7078 | +Furthermore, each value of an enumeration has the same representation |
| 7079 | +as the corresponding value of the underlying type. |
| 7080 | + |
7030 | 7081 | \pnum
|
7031 | 7082 | Two enumeration types are \defnx{layout-compatible enumerations}{layout-compatible!enumeration}
|
7032 | 7083 | if they have the same underlying type.
|
|
8691 | 8742 | a function,
|
8692 | 8743 | a namespace,
|
8693 | 8744 | an enumeration,
|
8694 |
| -an enumerator, or |
| 8745 | +an enumerator, |
| 8746 | +a concept, or |
8695 | 8747 | a template specialization.
|
8696 | 8748 |
|
8697 | 8749 | \pnum
|
|
0 commit comments