|
1356 | 1356 | class-key \opt{attribute-specifier-seq} \opt{nested-name-specifier} identifier\br |
1357 | 1357 | class-key simple-template-id\br |
1358 | 1358 | class-key nested-name-specifier \opt{\keyword{template}} simple-template-id\br |
1359 | | - elaborated-enum-specifier |
1360 | | -\end{bnf} |
1361 | | - |
1362 | | -\begin{bnf} |
1363 | | -\nontermdef{elaborated-enum-specifier}\br |
1364 | 1359 | \keyword{enum} \opt{nested-name-specifier} identifier |
1365 | 1360 | \end{bnf} |
1366 | 1361 |
|
|
4009 | 4004 | copy-initialization semantics\iref{dcl.init}. |
4010 | 4005 | The names in the |
4011 | 4006 | default argument are looked up, and the semantic constraints are checked, |
4012 | | -at the point where the default argument appears. |
| 4007 | +at the point where the default argument appears, except that |
| 4008 | +an immediate invocation\iref{expr.const} that |
| 4009 | +is a potentially-evaluated subexpression\iref{intro.execution} of |
| 4010 | +the \grammarterm{initializer-clause} in a \grammarterm{parameter-declaration} is |
| 4011 | +neither evaluated |
| 4012 | +nor checked for whether it is a constant expression at that point. |
4013 | 4013 | Name lookup and checking of semantic constraints for default |
4014 | 4014 | arguments of templated functions are performed as described in~\ref{temp.inst}. |
4015 | 4015 | \begin{example} |
|
4689 | 4689 | \end{note} |
4690 | 4690 | \end{itemize} |
4691 | 4691 |
|
| 4692 | +\pnum |
| 4693 | +An immediate invocation\iref{expr.const} that is not evaluated where |
| 4694 | +it appears\iref{dcl.fct.default,class.mem.general} |
| 4695 | +is evaluated and checked for whether it is |
| 4696 | +a constant expression at the point where |
| 4697 | +the enclosing \grammarterm{initializer} is used in |
| 4698 | +a function call, a constructor definition, or an aggregate initialization. |
| 4699 | + |
4692 | 4700 | \pnum |
4693 | 4701 | An \grammarterm{initializer-clause} followed by an ellipsis is a |
4694 | 4702 | pack expansion\iref{temp.variadic}. |
|
6192 | 6200 |
|
6193 | 6201 | \pnum |
6194 | 6202 | An explicitly defaulted special member function $\tcode{F}_1$ |
6195 | | -with type $\tcode{T}_1$ |
6196 | 6203 | is allowed to differ from |
6197 | 6204 | the corresponding special member function $\tcode{F}_2$ |
6198 | | -with type $\tcode{T}_2$ |
6199 | 6205 | that would have been implicitly declared, as follows: |
6200 | 6206 | \begin{itemize} |
6201 | 6207 | \item |
6202 | | - $\tcode{T}_1$ and $\tcode{T}_2$ may have differing \grammarterm{ref-qualifier}{s}; |
| 6208 | + $\tcode{F}_1$ and $\tcode{F}_2$ may have differing \grammarterm{ref-qualifier}{s}; |
6203 | 6209 | \item |
6204 | 6210 | if $\tcode{F}_2$ has an implicit object parameter of |
6205 | 6211 | type ``reference to \tcode{C}'', |
6206 | 6212 | $\tcode{F}_1$ may be an explicit object member function whose |
6207 | 6213 | explicit object parameter is of type ``reference to \tcode{C}'', |
6208 | | - in which case $\tcode{T}_1$ would differ from $\tcode{T}_2$ |
6209 | | - in that $\tcode{T}_1$ has an additional parameter; |
| 6214 | + in which case the type of $\tcode{F}_1$ would differ from the type of $\tcode{F}_2$ |
| 6215 | + in that the type of $\tcode{F}_1$ has an additional parameter; |
6210 | 6216 | \item |
6211 | | - $\tcode{T}_1$ and $\tcode{T}_2$ may have differing exception specifications; and |
| 6217 | + $\tcode{F}_1$ and $\tcode{F}_2$ may have differing exception specifications; and |
6212 | 6218 | \item |
6213 | 6219 | if $\tcode{F}_2$ has a non-object parameter of type \tcode{const C\&}, |
6214 | 6220 | the corresponding non-object parameter of $\tcode{F}_1$ may be of |
6215 | 6221 | type \tcode{C\&}. |
6216 | 6222 | \end{itemize} |
6217 | | -If $\tcode{T}_1$ differs from $\tcode{T}_2$ in a way |
| 6223 | +If the type of $\tcode{F}_1$ differs from the type of $\tcode{F}_2$ in a way |
6218 | 6224 | other than as allowed by the preceding rules, then: |
6219 | 6225 | \begin{itemize} |
6220 | 6226 | \item |
6221 | 6227 | if $\tcode{F}_1$ is an assignment operator, and |
6222 | | - the return type of $\tcode{T}_1$ differs from |
6223 | | - the return type of $\tcode{T}_2$ or |
| 6228 | + the return type of $\tcode{F}_1$ differs from |
| 6229 | + the return type of $\tcode{F}_2$ or |
6224 | 6230 | $\tcode{F}_1${'s} non-object parameter type is not a reference, |
6225 | 6231 | the program is ill-formed; |
6226 | 6232 | \item |
|
7161 | 7167 |
|
7162 | 7168 | \begin{bnf} |
7163 | 7169 | \nontermdef{using-enum-declaration}\br |
7164 | | - \terminal{using} elaborated-enum-specifier \terminal{;} |
| 7170 | + \keyword{using} \keyword{enum} using-enum-declarator \terminal{;} |
| 7171 | +\end{bnf} |
| 7172 | + |
| 7173 | +\begin{bnf} |
| 7174 | +\nontermdef{using-enum-declarator}\br |
| 7175 | + \opt{nested-name-specifier} identifier\br |
| 7176 | + \opt{nested-name-specifier} simple-template-id |
7165 | 7177 | \end{bnf} |
7166 | 7178 |
|
7167 | 7179 | \pnum |
7168 | | -The \grammarterm{elaborated-enum-specifier} |
7169 | | -shall not name a dependent type |
7170 | | -and the type shall have a reachable \grammarterm{enum-specifier}. |
| 7180 | +A \grammarterm{using-enum-declarator} |
| 7181 | +names the set of declarations found by |
| 7182 | +lookup\iref{basic.lookup.unqual,basic.lookup.qual} |
| 7183 | +for the \grammarterm{using-enum-declarator}. |
| 7184 | +The \grammarterm{using-enum-declarator} |
| 7185 | +shall designate a non-dependent type |
| 7186 | +with a reachable \grammarterm{enum-specifier}. |
7171 | 7187 |
|
7172 | 7188 | \pnum |
7173 | 7189 | A \grammarterm{using-enum-declaration} |
|
0 commit comments