Skip to content

[expr.typeid] Require class type to be complete #4827

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 17, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions source/expressions.tex
Original file line number Diff line number Diff line change
Expand Up @@ -3637,6 +3637,12 @@
of the program. Whether or not the destructor is called for the
\tcode{std::type_info} object at the end of the program is unspecified.

\pnum
If the type of the \grammarterm{expression} or \grammarterm{type-id} operand is
a (possibly cv-qualified) class type or
a reference to (possibly cv-qualified) class type,
that class shall be completely defined.

\pnum
When \keyword{typeid} is applied to a glvalue whose type is a
polymorphic class type\iref{class.virtual}, the result refers to a
Expand Down Expand Up @@ -3676,9 +3682,7 @@
\grammarterm{type-id}. If the type of the \grammarterm{type-id} is a reference
to a possibly cv-qualified type, the result of the
\keyword{typeid} expression refers to a \tcode{std::type_info} object
representing the cv-unqualified referenced type. If the type of
the \grammarterm{type-id} is a class type or a reference to a class type,
the class shall be completely-defined.
representing the cv-unqualified referenced type.
\begin{note}
The \grammarterm{type-id} cannot denote a function type with
a \grammarterm{cv-qualifier-seq} or a \grammarterm{ref-qualifier}\iref{dcl.fct}.
Expand Down