diff --git a/source/declarations.tex b/source/declarations.tex index 341c1bc1f3..f4e36d58b3 100644 --- a/source/declarations.tex +++ b/source/declarations.tex @@ -1090,21 +1090,32 @@ \indextext{specifier!\idxcode{inline}} \pnum +\indextext{specifier!\idxcode{inline}}% +\indextext{inline function}% +\indextext{inline variable}% The \keyword{inline} specifier shall be applied only to the declaration -of a variable or function. +of a function or variable. +The \keyword{inline} specifier shall not appear on a block scope declaration or +on the declaration of a function parameter. +If the \keyword{inline} specifier is used in a friend function declaration, that +declaration shall be a definition or the function shall have previously +been declared inline. \pnum -\indextext{specifier!\idxcode{inline}}% -\indextext{inline function}% A function declaration\iref{dcl.fct,class.mfct,class.friend} with an \keyword{inline} specifier declares an -\defnadj{inline}{function}. The inline specifier indicates to -the implementation that inline substitution of the function body at the -point of call is to be preferred to the usual function call mechanism. -An implementation is not required to perform this inline substitution at -the point of call; however, even if this inline substitution is omitted, -the other rules for inline functions specified in this subclause shall -still be respected. +\defnadj{inline}{function}. +A variable declaration with an \keyword{inline} specifier declares an +\defnadj{inline}{variable}. +\begin{note} +An inline function or variable +with external or module linkage +can be defined in multiple translation units\iref{basic.def.odr}, +but is one entity with one address. +A type or \keyword{static} variable +defined in the body of such a function +is therefore a single entity. +\end{note} \begin{note} The \keyword{inline} keyword has no effect on the linkage of a function. In certain cases, an inline function cannot use names with internal linkage; @@ -1112,15 +1123,13 @@ \end{note} \pnum -A variable declaration with an \keyword{inline} specifier declares an -\defnadj{inline}{variable}. - -\pnum -The \keyword{inline} specifier shall not appear on a block scope declaration or -on the declaration of a function parameter. -If the \keyword{inline} specifier is used in a friend function declaration, that -declaration shall be a definition or the function shall have previously -been declared inline. +The inline specifier indicates to +the implementation that inline substitution of the function body at the +point of call is to be preferred to the usual function call mechanism. +An implementation is not required to perform this inline substitution at +the point of call; however, even if this inline substitution is omitted, +the other rules for inline functions specified in this subclause shall +still be respected. \pnum If a definition of a function or variable is reachable @@ -1136,17 +1145,6 @@ before its definition becomes reachable in a translation unit. \end{note} -\pnum -\begin{note} -An inline function or variable -with external or module linkage -can be defined in multiple translation units\iref{basic.def.odr}, -but is one entity with one address. -A type or \keyword{static} variable -defined in the body of such a function -is therefore a single entity. -\end{note} - \pnum If an inline function or variable that is attached to a named module is declared in a definition domain,