Skip to content

Commit 2dc0d72

Browse files
burblebeetkoeppe
authored andcommitted
CWG2661 Missing disambiguation rule for pure-specifier vs. brace-or-equal-initializer
1 parent f0eb8e8 commit 2dc0d72

1 file changed

Lines changed: 13 additions & 1 deletion

File tree

‎source/classes.tex‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@
483483
\nontermdef{member-declarator}\br
484484
declarator \opt{virt-specifier-seq} \opt{pure-specifier}\br
485485
declarator requires-clause\br
486-
declarator \opt{brace-or-equal-initializer}\br
486+
declarator brace-or-equal-initializer\br
487487
\opt{identifier} \opt{attribute-specifier-seq} \terminal{:} constant-expression \opt{brace-or-equal-initializer}
488488
\end{bnf}
489489

@@ -504,6 +504,18 @@
504504
\terminal{=} \terminal{0}
505505
\end{bnf}
506506

507+
\pnum
508+
In the absence of a \grammarterm{virt-specifier-seq},
509+
the token sequence \tcode{= 0} is treated as a \grammarterm{pure-specifier}
510+
if the type of the \grammarterm{declarator-id}\iref{dcl.meaning.general}
511+
is a function type, and
512+
is otherwise treated as a \grammarterm{brace-or-equal-initializer}.
513+
\begin{note}
514+
If the member declaration acquires a function type through
515+
template instantiation,
516+
the program is ill-formed; see~\ref{temp.spec.general}.
517+
\end{note}
518+
507519
\pnum
508520
\indextext{definition!class}%
509521
The \grammarterm{member-specification} in a class definition declares the

0 commit comments

Comments
 (0)