|
1090 | 1090 | \indextext{specifier!\idxcode{inline}} |
1091 | 1091 |
|
1092 | 1092 | \pnum |
| 1093 | +\indextext{specifier!\idxcode{inline}}% |
| 1094 | +\indextext{inline function}% |
| 1095 | +\indextext{inline variable}% |
1093 | 1096 | The \keyword{inline} specifier shall be applied only to the declaration |
1094 | | -of a variable or function. |
| 1097 | +of a function or variable. |
| 1098 | +The \keyword{inline} specifier shall not appear on a block scope declaration or |
| 1099 | +on the declaration of a function parameter. |
| 1100 | +If the \keyword{inline} specifier is used in a friend function declaration, that |
| 1101 | +declaration shall be a definition or the function shall have previously |
| 1102 | +been declared inline. |
1095 | 1103 |
|
1096 | 1104 | \pnum |
1097 | | -\indextext{specifier!\idxcode{inline}}% |
1098 | | -\indextext{inline function}% |
1099 | 1105 | A function declaration\iref{dcl.fct,class.mfct,class.friend} |
1100 | 1106 | 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. |
| 1107 | +\defnadj{inline}{function}. |
| 1108 | +A variable declaration with an \keyword{inline} specifier declares an |
| 1109 | +\defnadj{inline}{variable}. |
| 1110 | +\begin{note} |
| 1111 | +An inline function or variable |
| 1112 | +with external or module linkage |
| 1113 | +can be defined in multiple translation units\iref{basic.def.odr}, |
| 1114 | +but is one entity with one address. |
| 1115 | +A type or \keyword{static} variable |
| 1116 | +defined in the body of such a function |
| 1117 | +is therefore a single entity. |
| 1118 | +\end{note} |
1108 | 1119 | \begin{note} |
1109 | 1120 | The \keyword{inline} keyword has no effect on the linkage of a function. |
1110 | 1121 | In certain cases, an inline function cannot use names with internal linkage; |
1111 | 1122 | see~\ref{basic.link}. |
1112 | 1123 | \end{note} |
1113 | 1124 |
|
1114 | 1125 | \pnum |
1115 | | -A variable declaration with an \keyword{inline} specifier declares an |
1116 | | -\defnadj{inline}{variable}. |
1117 | | - |
1118 | | -\pnum |
1119 | | -The \keyword{inline} specifier shall not appear on a block scope declaration or |
1120 | | -on the declaration of a function parameter. |
1121 | | -If the \keyword{inline} specifier is used in a friend function declaration, that |
1122 | | -declaration shall be a definition or the function shall have previously |
1123 | | -been declared inline. |
| 1126 | +The inline specifier indicates to |
| 1127 | +the implementation that inline substitution of the function body at the |
| 1128 | +point of call is to be preferred to the usual function call mechanism. |
| 1129 | +An implementation is not required to perform this inline substitution at |
| 1130 | +the point of call; however, even if this inline substitution is omitted, |
| 1131 | +the other rules for inline functions specified in this subclause shall |
| 1132 | +still be respected. |
1124 | 1133 |
|
1125 | 1134 | \pnum |
1126 | 1135 | If a definition of a function or variable is reachable |
|
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