|
1089 | 1089 | \rSec2[dcl.inline]{The \keyword{inline} specifier}%
|
1090 | 1090 | \indextext{specifier!\idxcode{inline}}
|
1091 | 1091 |
|
1092 |
| -\pnum |
1093 |
| -The \keyword{inline} specifier shall be applied only to the declaration |
1094 |
| -of a variable or function. |
1095 |
| - |
1096 | 1092 | \pnum
|
1097 | 1093 | \indextext{specifier!\idxcode{inline}}%
|
1098 | 1094 | \indextext{inline function}%
|
| 1095 | +\indextext{inline variable}% |
| 1096 | +The \keyword{inline} specifier shall be applied only to the declaration |
| 1097 | +of a function or variable. |
1099 | 1098 | A function declaration\iref{dcl.fct,class.mfct,class.friend}
|
1100 | 1099 | with an \keyword{inline} specifier declares an
|
1101 |
| -\defnadj{inline}{function}. The inline specifier indicates to |
1102 |
| -the implementation that inline substitution of the function body at the |
1103 |
| -point of call is to be preferred to the usual function call mechanism. |
1104 |
| -An implementation is not required to perform this inline substitution at |
1105 |
| -the point of call; however, even if this inline substitution is omitted, |
1106 |
| -the other rules for inline functions specified in this subclause shall |
1107 |
| -still be respected. |
| 1100 | +\defnadj{inline}{function}. |
| 1101 | +A variable declaration with an \keyword{inline} specifier declares an |
| 1102 | +\defnadj{inline}{variable}. |
| 1103 | +\begin{note} |
| 1104 | +An inline function or variable |
| 1105 | +with external or module linkage |
| 1106 | +can be defined in multiple translation units\iref{basic.def.odr}, |
| 1107 | +but is one entity with one address. |
| 1108 | +A type or \keyword{static} variable |
| 1109 | +defined in the body of such a function |
| 1110 | +is therefore a single entity. |
| 1111 | +\end{note} |
1108 | 1112 | \begin{note}
|
1109 | 1113 | The \keyword{inline} keyword has no effect on the linkage of a function.
|
1110 | 1114 | In certain cases, an inline function cannot use names with internal linkage;
|
1111 | 1115 | see~\ref{basic.link}.
|
1112 | 1116 | \end{note}
|
1113 | 1117 |
|
1114 | 1118 | \pnum
|
1115 |
| -A variable declaration with an \keyword{inline} specifier declares an |
1116 |
| -\defnadj{inline}{variable}. |
| 1119 | +The inline specifier indicates to |
| 1120 | +the implementation that inline substitution of the function body at the |
| 1121 | +point of call is to be preferred to the usual function call mechanism. |
| 1122 | +An implementation is not required to perform this inline substitution at |
| 1123 | +the point of call; however, even if this inline substitution is omitted, |
| 1124 | +the other rules for inline functions specified in this subclause shall |
| 1125 | +still be respected. |
1117 | 1126 |
|
1118 | 1127 | \pnum
|
1119 | 1128 | The \keyword{inline} specifier shall not appear on a block scope declaration or
|
|
1136 | 1145 | before its definition becomes reachable in a translation unit.
|
1137 | 1146 | \end{note}
|
1138 | 1147 |
|
1139 |
| -\pnum |
1140 |
| -\begin{note} |
1141 |
| -An inline function or variable |
1142 |
| -with external or module linkage |
1143 |
| -can be defined in multiple translation units\iref{basic.def.odr}, |
1144 |
| -but is one entity with one address. |
1145 |
| -A type or \keyword{static} variable |
1146 |
| -defined in the body of such a function |
1147 |
| -is therefore a single entity. |
1148 |
| -\end{note} |
1149 |
| - |
1150 | 1148 | \pnum
|
1151 | 1149 | If an inline function or variable that is attached to a named module
|
1152 | 1150 | is declared in a definition domain,
|
|
0 commit comments