|
4078 | 4078 | \begin{itemize}
|
4079 | 4079 | \item \grammarterm{simple-declaration} or a \grammarterm{function-definition} in namespace scope,
|
4080 | 4080 | \item \grammarterm{member-declaration},
|
4081 |
| -\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration}, |
4082 |
| -unless that \grammarterm{parameter-declaration} appears in a default argument |
4083 |
| -\begin{note} This includes friend function declarations. \end{note}, |
| 4081 | +\item \grammarterm{parameter-declaration} in a \grammarterm{member-declaration}% |
| 4082 | +\footnote{This includes friend function declarations.}, |
| 4083 | +unless that \grammarterm{parameter-declaration} appears in a default argument, |
4084 | 4084 | \item \grammarterm{parameter-declaration} in a \grammarterm{declarator}
|
4085 | 4085 | of a function or function template declaration
|
4086 | 4086 | whose \grammarterm{declarator-id} is qualified,
|
|
4113 | 4113 | \begin{example}
|
4114 | 4114 | \begin{codeblock}
|
4115 | 4115 | template<class T> T::R f(); // OK, return type of a function declaration at global scope
|
4116 |
| -template<class T> void f(T::R); // ill-formed (no diagnostic required), attempt to declare a \tcode{void} variable template |
| 4116 | +template<class T> void f(T::R); // ill-formed (no diagnostic required), attempt to declare |
| 4117 | + // a \tcode{void} variable template |
4117 | 4118 | template<class T> struct S {
|
4118 | 4119 | using Ptr = PtrTraits<T>::Ptr; // OK, in a \grammarterm{defining-type-id}
|
4119 | 4120 | T::R f(T::P p) { // OK, class scope
|
4120 | 4121 | return static_cast<T::R>(p); // OK, \grammarterm{type-id} of a \tcode{static_cast}
|
4121 | 4122 | }
|
4122 |
| - auto g() -> S<T*>::Ptr; // OK, \grammarterm{trailing-return-type} |
| 4123 | + auto g() -> S<T*>::Ptr; // OK, \grammarterm{trailing-return-type} |
4123 | 4124 | };
|
4124 | 4125 | template<typename T> void f() {
|
4125 | 4126 | void (*pf)(T::X); // variable \tcode{pf} of type \tcode{void*} initialized with \tcode{T::X}
|
|
4174 | 4175 | \pnum
|
4175 | 4176 | \indextext{checking!syntax}%
|
4176 | 4177 | \indextext{checking!point of error}%
|
| 4178 | +The validity of a template may be checked prior to any instantiation. |
4177 | 4179 | \begin{note}
|
4178 | 4180 | Knowing which names are type names allows the syntax of every template
|
4179 |
| -to be checked. |
| 4181 | +to be checked in this way. |
4180 | 4182 | \end{note}
|
4181 | 4183 | The program is ill-formed, no diagnostic required, if:
|
4182 | 4184 |
|
|
0 commit comments