|
511 | 511 | either: |
512 | 512 | \begin{itemize} |
513 | 513 | \item the intervening scope is a block scope, or |
514 | | -\item the intervening scope is the function parameter scope of a \grammarterm{lambda-expression} |
| 514 | +\item the intervening scope is the function parameter scope of a \grammarterm{lambda-expression}, or |
| 515 | +\item the intervening scope is the lambda scope of |
| 516 | +a \grammarterm{lambda-expression} |
515 | 517 | that has a \grammarterm{simple-capture} |
516 | 518 | naming the entity or has a \grammarterm{capture-default}, and |
517 | 519 | the block scope of the \grammarterm{lambda-expression} |
|
2664 | 2666 |
|
2665 | 2667 | \pnum |
2666 | 2668 | \indextext{translation unit}% |
2667 | | -A name is said to have \defn{linkage} when it can denote the same |
2668 | | -object, reference, function, type, template, namespace or value as a |
2669 | | -name introduced by a declaration in another scope: |
2670 | | -\begin{itemize} |
2671 | | -\item When a name has \defnadj{external}{linkage}, |
2672 | | -the entity it denotes |
2673 | | -can be referred to by names from scopes of other translation units or |
2674 | | -from other scopes of the same translation unit. |
2675 | | - |
2676 | | -\item When a name has \defnx{module linkage}{linkage!module}, |
2677 | | -the entity it denotes |
2678 | | -can be referred to by names from other scopes of the same module unit\iref{module.unit} or |
2679 | | -from scopes of other module units of that same module. |
2680 | | - |
2681 | | -\item When a name has \defnadj{internal}{linkage}, |
2682 | | -the entity it denotes |
2683 | | -can be referred to by names from other scopes in the same translation |
2684 | | -unit. |
2685 | | - |
2686 | | -\item When a name has \indextext{linkage!no}\defn{no linkage}, the entity it denotes |
2687 | | -cannot be referred to by names from other scopes. |
2688 | | -\end{itemize} |
| 2669 | +A name can have |
| 2670 | +\defnadj{external}{linkage}, |
| 2671 | +\defnadj{module}{linkage}, |
| 2672 | +\defnadj{internal}{linkage}, or |
| 2673 | +\defnadj{no}{linkage}, |
| 2674 | +as determined by the rules below. |
| 2675 | +\begin{note} |
| 2676 | +All declarations of an entity with a name with internal linkage |
| 2677 | +appear in the same translation unit. |
| 2678 | +All declarations of an entity with module linkage |
| 2679 | +are attached to the same module. |
| 2680 | +\end{note} |
2689 | 2681 |
|
2690 | 2682 | \pnum |
2691 | 2683 | \indextext{linkage!\idxcode{static} and}% |
|
2746 | 2738 | has its linkage determined as follows: |
2747 | 2739 | \begin{itemize} |
2748 | 2740 | \item |
| 2741 | +\indextext{friend function!linkage of}% |
| 2742 | +if the entity is a function or function template |
| 2743 | +first declared in a friend declaration and |
| 2744 | +that declaration is a definition and |
| 2745 | +the enclosing class is defined within an \grammarterm{export-declaration}, |
| 2746 | +the name has the same linkage, if any, |
| 2747 | +as the name of the enclosing class\iref{class.friend}; |
| 2748 | +\item |
| 2749 | +otherwise, |
| 2750 | +\indextext{friend function!linkage of}% |
| 2751 | +if the entity is a function or function template |
| 2752 | +declared in a friend declaration and |
| 2753 | +a corresponding non-friend declaration is reachable, |
| 2754 | +%FIXME: Which declaration is "that prior declaration"? |
| 2755 | +%FIXME: "prior" with respect to what? And what about dependent lookup? |
| 2756 | +the name has the linkage determined from that prior declaration, |
| 2757 | +\item |
| 2758 | +otherwise, |
2749 | 2759 | if the enclosing namespace has internal linkage, |
2750 | 2760 | the name has internal linkage; |
2751 | 2761 | \item |
|
3450 | 3460 | The \defn{lifetime} of an object or reference is a runtime property of the |
3451 | 3461 | object or reference. |
3452 | 3462 | A variable is said to have \defnadj{vacuous}{initialization} |
3453 | | -if it is default-initialized and, |
| 3463 | +if it is default-initialized, no other initialization is performed, and, |
3454 | 3464 | if it is of class type or a (possibly multidimensional) array thereof, |
3455 | | -that class type has a trivial default constructor. |
| 3465 | +a trivial constructor of that class type is selected for |
| 3466 | +the default-initialization. |
3456 | 3467 | The lifetime of an object of type \tcode{T} begins when: |
3457 | 3468 | \begin{itemize} |
3458 | 3469 | \item storage with the proper alignment and size |
|
4431 | 4442 |
|
4432 | 4443 | \pnum |
4433 | 4444 | When an object of class type \tcode{X} |
4434 | | -is passed to or returned from a function, |
| 4445 | +is passed to or returned from a potentially-evaluated function call, |
4435 | 4446 | if \tcode{X} has at least one eligible copy or move constructor\iref{special}, |
4436 | 4447 | each such constructor is trivial, |
4437 | 4448 | and the destructor of \tcode{X} is either trivial or deleted, |
|
4454 | 4465 | \indextext{temporary!constructor for}% |
4455 | 4466 | \indextext{temporary!destructor for}% |
4456 | 4467 | \indextext{temporary!destruction of}% |
4457 | | -When an implementation introduces a temporary object of a class that has a |
4458 | | -non-trivial constructor\iref{class.default.ctor,class.copy.ctor}, |
4459 | | -it shall ensure that a constructor is called for the temporary object. |
4460 | | -Similarly, the destructor shall be called for a temporary with a non-trivial |
4461 | | -destructor\iref{class.dtor}. |
4462 | 4468 | Temporary objects are destroyed as the last step |
4463 | 4469 | in evaluating |
4464 | 4470 | the full-expression\iref{intro.execution} |
|
4476 | 4482 | \pnum |
4477 | 4483 | \indextext{initializer!temporary and declarator}% |
4478 | 4484 | \indextext{temporary!order of destruction of}% |
4479 | | -There are four contexts in which temporaries are destroyed at a different |
| 4485 | +There are five contexts in which temporaries are destroyed at a different |
4480 | 4486 | point than the end of the full-expression. |
4481 | 4487 | The first context is when a default constructor is called to initialize |
4482 | 4488 | an element of an array with no corresponding initializer\iref{dcl.init}. |
|
4602 | 4608 | the object persists for the lifetime of the reference |
4603 | 4609 | initialized by the \grammarterm{for-range-initializer}. |
4604 | 4610 |
|
| 4611 | +\pnum |
| 4612 | +The fifth context is when a temporary object |
| 4613 | +is created in a structured binding declaration\iref{dcl.struct.bind}. |
| 4614 | +Any temporary objects introduced by |
| 4615 | +the \grammarterm{initializer}{s} for the variables |
| 4616 | +with unique names |
| 4617 | +are destroyed at the end of the structured binding declaration. |
| 4618 | + |
4605 | 4619 | \pnum |
4606 | 4620 | Let \tcode{x} and \tcode{y} each be either |
4607 | 4621 | a temporary object whose lifetime is not extended, or |
|
5760 | 5774 | An extended floating-point type with the same set of values as |
5761 | 5775 | more than one cv-unqualified standard floating-point type |
5762 | 5776 | has a rank equal to the rank of \keyword{double}. |
| 5777 | +\begin{tailnote} |
| 5778 | +The treatment of \tcode{std::float64_t} differs from |
| 5779 | +that of the analoguous \tcode{_Float64} in C, |
| 5780 | +for example on platforms where all of |
| 5781 | +\tcode{\keyword{long} \keyword{double}}, |
| 5782 | +\keyword{double}, and |
| 5783 | +\tcode{std::float64_t} |
| 5784 | +have the same set of values (see \IsoCUndated{}:2024 H.4.2). |
| 5785 | +\end{tailnote} |
5763 | 5786 | \end{itemize} |
5764 | 5787 | \begin{note} |
5765 | 5788 | The conversion ranks of floating-point types \tcode{T1} and \tcode{T2} |
|
5878 | 5901 | \item |
5879 | 5902 | an immediate invocation\iref{expr.const}, |
5880 | 5903 | \item |
5881 | | -an \grammarterm{init-declarator}\iref{dcl.decl} or |
| 5904 | +an \grammarterm{init-declarator}\iref{dcl.decl} |
| 5905 | +(including such introduced by a structured binding\iref{dcl.struct.bind}) or |
5882 | 5906 | a \grammarterm{mem-initializer}\iref{class.base.init}, |
5883 | 5907 | including the constituent expressions of the initializer, |
5884 | 5908 | \item |
|
0 commit comments