-
Notifications
You must be signed in to change notification settings - Fork 790
[basic.lval,expr.delete] 'dynamic type' refers to lvalues, not objects #2265
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
Open
jensmaurer
wants to merge
1
commit into
cplusplus:main
Choose a base branch
from
jensmaurer:b14
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -306,7 +306,7 @@ | |
object can or cannot be aliased. | ||
\end{footnote} | ||
\begin{itemize} | ||
\item the dynamic type of the object, | ||
\item \cv{} \tcode{T} | ||
|
||
\item a type that is the signed or unsigned type corresponding to the | ||
dynamic type of the object, or | ||
|
@@ -3102,10 +3102,10 @@ | |
of the object expression is called; such a call is referred to as a | ||
\defnx{virtual function call}{function!virtual function call}. | ||
\begin{note} | ||
The dynamic type is the type of the object referred to by the | ||
current value of the object expression. \ref{class.cdtor}~describes the | ||
behavior of virtual function calls when the object expression | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Simply strike the first sentence of the note instead of trying to fix it. |
||
refers to | ||
The dynamic type is the type of the most derived object referred to by the | ||
current value of the object expression\iref{defns.dynamic.type}. | ||
\ref{class.cdtor}~describes the behavior of virtual function calls | ||
when the object expression refers to | ||
an object under construction or destruction. | ||
\end{note} | ||
|
||
|
@@ -4028,10 +4028,10 @@ | |
containing the original member, the resulting pointer to member points | ||
to the original member. Otherwise, the behavior is undefined. | ||
\begin{note} | ||
Although class \tcode{B} need not contain the original member, the | ||
dynamic type of the object with which indirection through the pointer | ||
to member is performed must contain the original member; | ||
see~\ref{expr.mptr.oper}. | ||
Although class \tcode{B} need not contain the original member, | ||
the dynamic type of the object expression | ||
appearing in a pointer-to-member operation | ||
must contain the original member; see~\ref{expr.mptr.oper}. | ||
\end{note} | ||
|
||
\pnum | ||
|
@@ -5537,6 +5537,8 @@ | |
type by calling the above-mentioned conversion function, and the | ||
converted operand is used in place of the original operand for the | ||
remainder of this subclause. | ||
The lvalue formed by indirection of the operand is said to refer | ||
to the object to be deleted. | ||
In a single-object delete expression, the value of the operand of | ||
\keyword{delete} may be a null pointer value, | ||
a pointer value | ||
|
@@ -5569,14 +5571,15 @@ | |
|
||
\pnum | ||
\indextext{\idxcode{delete}!undefined}% | ||
In a single-object delete expression, if the static type of the object to be | ||
deleted is not similar\iref{conv.qual} to its dynamic type | ||
In a single-object delete expression, if the static type of the lvalue | ||
that refers to the object to be deleted is not similar\iref{conv.qual} to its dynamic type | ||
and the selected deallocation function (see below) | ||
is not a destroying operator delete, | ||
the static type shall be a base | ||
class of the dynamic type of the object to be deleted and the static type shall | ||
have a virtual destructor or the behavior is undefined. In an array delete | ||
expression, if the dynamic type of the object to be deleted is not similar to | ||
have a virtual destructor or the behavior is undefined. | ||
In an array delete expression, if the dynamic type of the lvalue | ||
that refers to the first element of the object to be deleted is not similar to | ||
its static type, the behavior is undefined. | ||
|
||
\pnum | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"static type" is also a property of an expression :(
http://eel.is/c++draft/intro.defs#defns.static.type