Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

WIP: [std] Add Annex for undefined and IFNDR behavior #7826

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

Draft
wants to merge 21 commits into
base: main
Choose a base branch
Loading
from
Draft
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
2ed9326
[std] Add Annex for undefined and IFNDR behavior
jensmaurer Apr 5, 2025
6e12efa
[class.cdtor] Remove duplicate UB labels
jensmaurer Apr 5, 2025
f80cd9c
[expr.delete] Remove duplicate UB label
jensmaurer Apr 11, 2025
d92a145
[conv.fpint] Remove duplicate UB label
jensmaurer Apr 11, 2025
9d19eae
[ifndr.lex] Replace C++ with \Cpp
jensmaurer Apr 5, 2025
428d627
[ub,ifndr] Fix column alignment of comments
jensmaurer Apr 5, 2025
29f2045
[ifndr] Fix cross-references
jensmaurer Apr 5, 2025
2115438
[ub] Replace non-ASCII chars
jensmaurer Apr 5, 2025
20ffb6e
[check] Handle ub/ifndr labels
jensmaurer Apr 6, 2025
2ce67b5
[check] Exclude [ub] and [ifndr] from sibling checking for now
jensmaurer Apr 11, 2025
1372087
[ub.cpp.concat] Remove universal-character-name formation from ##; no…
jensmaurer Apr 5, 2025
51fd05f
[ifndr] Use codeblocktu
jensmaurer Apr 6, 2025
2be6676
Rename label expr.ass.overlap to expr.assign.overlap
jensmaurer Apr 13, 2025
94bbba6
[ub.basic.stc.dynamic] Fix typo
jensmaurer Apr 14, 2025
71be854
[ub] Fix some formatting (#7828)
jensmaurer Apr 22, 2025
a6064c6
Remove class.dtor.not.class.type (#7835)
jensmaurer Apr 23, 2025
0788337
Remove incorrect class.union.assignment.not.start.lifetime (#7833)
jensmaurer Apr 23, 2025
3c759d1
[ub.general,ifndr.general] Avoid hanging paragraphs by introducing 'G…
jensmaurer May 4, 2025
88a6384
[ub] Add many missing entries to UB annex (#7864)
notadragon May 14, 2025
35381f1
[conv.fpint] Remove unreferenced \ubdef that causes an undefined symb…
jensmaurer May 16, 2025
13307cb
[ub] small fixes to examples (#7890)
notadragon May 28, 2025
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
Prev Previous commit
Next Next commit
Remove class.dtor.not.class.type (#7835)
  • Loading branch information
jensmaurer authored Apr 23, 2025
commit a6064c641f94f6f4efe6133eb1092e278aeaa7dc
2 changes: 1 addition & 1 deletion 2 source/classes.tex
Original file line number Diff line number Diff line change
Expand Up @@ -2289,7 +2289,7 @@
that is, if the object is not of the destructor's class type and
not of a class derived from the destructor's class type (including when
the destructor is invoked via a null pointer value), the program has
undefined behavior\ubdef{class.dtor.not.class.type}.
undefined behavior.
\begin{note}
Invoking \keyword{delete} on a null pointer does not call the
destructor; see \ref{expr.delete}.
Expand Down
42 changes: 0 additions & 42 deletions 42 source/ub.tex
Original file line number Diff line number Diff line change
Expand Up @@ -1180,48 +1180,6 @@

\rSec2[ub.class.dtor]{Destructors}

\pnum
\ubxref{class.dtor.not.class.type} \\
The invocation of a destructor is subject to the usual rules for
member functions \iref{class.mfct}; that is, if the object is not of the destructor's class type and not of a class derived
from the destructor's class type (including when the destructor is invoked via a null pointer value), the
program has undefined behavior.

\pnum
\begin{example}
\begin{codeblock}
#include <new>

struct X {};

void f() {
X *x = nullptr;
x->~X(); // undefined behavior, invoked using a null pointer value
}

struct Y {};
void h() {
alignas(X) char buf[sizeof(X)];
X *p = new (buf) X(); // use \tcode{buf[] }and initialize

Y *yp = reinterpret_cast<Y *>(p);
yp->Y::~Y(); // undefined behavior, destructor of \tcode{Y} called for object of type \tcode{X}
}

struct Base {
virtual ~Base();
};
struct Derived : Base {};

int k() {
Base *b = new Base;
Derived *d = static_cast<Derived *>(b);
d->~Derived(); // undefined behavior, destructor of Derived call for object of
// type \tcode{Base}
}
\end{codeblock}
\end{example}

\pnum
\ubxref{class.dtor.no.longer.exists} \\
Once a destructor is invoked for an object, the object no longer exists; the behavior is undefined if the
Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.