|
376 | 376 | the declaration of a static member function (although its type and value category
|
377 | 377 | are defined within a static member function as they are within a non-static
|
378 | 378 | member function). \begin{note} This is because declaration matching does not
|
379 |
| -occur until the complete declarator is known. \end{note} Unlike the object |
380 |
| -expression in other contexts, \tcode{*this} is not required to be of complete |
381 |
| -type for purposes of class member access~(\ref{expr.ref}) outside the member |
382 |
| -function body. \begin{note} Only class members declared prior to the declaration |
383 |
| -are visible. \end{note} |
| 379 | +occur until the complete declarator is known. \end{note} |
| 380 | +\begin{note} |
| 381 | +In a \grammarterm{trailing-return-type}, |
| 382 | +the class being defined is not required to be complete |
| 383 | +for purposes of class member access~(\ref{expr.ref}). |
| 384 | +Class members declared later are not visible. |
384 | 385 | \begin{example}
|
385 | 386 | \begin{codeblock}
|
386 | 387 | struct A {
|
|
391 | 392 | template auto A::f(int t) -> decltype(t + g());
|
392 | 393 | \end{codeblock}
|
393 | 394 | \end{example}
|
| 395 | +\end{note} |
394 | 396 |
|
395 | 397 | \pnum
|
396 | 398 | Otherwise, if a \grammarterm{member-declarator} declares a non-static data
|
|
1843 | 1845 | \pnum
|
1844 | 1846 | \indextext{type!incomplete}%
|
1845 | 1847 | For the first option (dot) the first expression
|
1846 |
| -shall be a glvalue having complete class type. |
| 1848 | +shall be a glvalue having class type. |
1847 | 1849 | For the second option (arrow) the first expression
|
1848 |
| -shall be a prvalue having pointer to complete class type. |
| 1850 | +shall be a prvalue having pointer to class type. |
| 1851 | +In both cases, the class type shall be complete |
| 1852 | +unless the class member access appears in the definition of that class. |
| 1853 | +\begin{note} |
| 1854 | +If the class is incomplete, lookup in the complete class type |
| 1855 | +is required to refer to the same declaration~(\ref{basic.scope.class}). |
| 1856 | +\end{note} |
1849 | 1857 | The expression \tcode{E1->E2} is
|
1850 | 1858 | converted to the equivalent form \tcode{(*(E1)).E2}; the remainder of
|
1851 | 1859 | \ref{expr.ref}~will address only the first option (dot).\footnote{Note that
|
|
0 commit comments