-
Notifications
You must be signed in to change notification settings - Fork 764
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
[2025-02 CWG Motion 5] P2900R14 - Contracts for C++ #7695
base: main
Are you sure you want to change the base?
Conversation
10cb85c
to
a470da8
Compare
source/declarations.tex
Outdated
@@ -2283,7 +2297,7 @@ | |||
\begin{bnf} | |||
\nontermdef{init-declarator}\br | |||
declarator \opt{initializer}\br |
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.
\opt
needs to be removed here
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.
good catch, i totally missed that edit. Done.
source/intro.tex
Outdated
@@ -788,10 +795,14 @@ | |||
\begin{itemize} | |||
\item | |||
a preprocessing translation unit containing | |||
a \tcode{\#error} preprocessing directive\iref{cpp.error} or | |||
a \tcode{\#error} preprocessing directive\iref{cpp.error}, %JMB: this last comma was a mistake in P2900, it was not in green. |
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.
In general, fixing commas and such can be done on-the-fly without much ado.
Please remove the "JMB" comment; we don't want that in the merged .tex.
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.
Yes, I just wanted to make sure additional eyes saw any deviations that occured relative to P2900's cwg-reviewed text. (And also yes, we shouldn't merge this until all of the JMB comments have been looked at and removed).
source/intro.tex
Outdated
\pnum | ||
\indextext{observable checkpoint} | ||
Certain events in the execution of a program | ||
are termed \defnadj{observable}{checkpoints}. | ||
\begin{note} | ||
A call to \tcode{std::observable}\iref{utility.undefined} | ||
is an observable checkpoint, |
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.
This is duplicate with the preceding paragraph. Somehow, this needs to be rebased properly.
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.
boo on git. fixing.
source/basic.tex
Outdated
@@ -544,9 +551,10 @@ | |||
between the point at which the entity is introduced and the scope | |||
(where \tcode{*\keyword{this}} is considered to be introduced | |||
within the innermost enclosing class or non-lambda function definition scope), | |||
either: | |||
either: %JMB: Potential drive-by, we should remove the : and the first two "or"s. |
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.
I'm ok with applying the drive-by.
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.
done
source/basic.tex
Outdated
in the body of the called function. | ||
the postfix expression designating \placeholder{f} | ||
are sequenced before | ||
every precondition assertion of \placeholder{f}\iref{dcl.contract.func}, %JMB: This said "of the called function", changed to "of f" |
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.
Ack, looks good, remove "JMB".
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.
done
source/basic.tex
Outdated
every expression or statement | ||
in the body of \placeholder{f}, | ||
which in turn are sequenced before | ||
every postcondition assertion of \placeholder{f}. %JMB: This says "the called function" again in P2900 |
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.
Ack, looks good, remove "JMB"
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.
done
source/basic.tex
Outdated
of the predicate of a contract assertion, | ||
no diagnostic required. | ||
|
||
%JMB: This paragraph was not in P2900, but the note is not directly tied to the paragraph above. |
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.
Ack, that's fine, remove JMB.
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.
done
source/basic.tex
Outdated
are const\iref{expr.prim.id.unqual}, %JMB: P2900 had this const in code font | ||
\tcode{this} is a pointer to const\iref{expr.prim.this}, %JMB: P2900 had this const in code font |
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.
This is a note. I agree non-code-font is slightly better (more casual, in a casual sentence). Remove JMBs.
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.
done
source/lib-intro.tex
Outdated
@@ -3606,7 +3559,7 @@ | |||
in~\ref{global.functions}, member functions in~\ref{member.functions}, data race | |||
avoidance in~\ref{res.on.data.races}, access specifiers | |||
in~\ref{protection.within.classes}, class derivation in~\ref{derivation}, and | |||
exceptions in~\ref{res.on.exception.handling}. | |||
exceptions in~\ref{res.on.exception.handling}. %JMB: This intro fluff should add "and contract assertions in~\ref{res.contract.assertions} Also, the "its use" doesn't seem right in this sentence. Can I make this a bulleted list so that it resembles a sentence again? |
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.
Please drop the JMB in a fix-up commit to the original one (will be squashed).
Then, add a separate commit (same pull request) with proper "[label] title" commit description that improves this (yes, a bulleted list seems great). Do not silently improve this in the original paper-applying commit.
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.
done
source/overloading.tex
Outdated
\item | ||
otherwise, | ||
the implied object argument is | ||
\tcode{(*\keyword{this})}. %JMB: The \keyword on this was missing |
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.
Ack, trivially obvious fix, remove JMB.
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.
done
source/statements.tex
Outdated
by those \grammarterm{assertion-statement}s. | ||
\begin{note} | ||
A sequence of \grammarterm{assertion-statement}s | ||
can thus be repeatedly evaluated as a group. %JMB: Should we remove the "thus"? |
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.
It's in the paper, it's in a note, and it's a consequence from the "evaluated in sequence" normative text. Leave it in; remove JMB.
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.
done
37d5acb
to
f9fac8b
Compare
Each successive temporary object | ||
is initialized from the previous one | ||
as if by direct initialization if \tcode{X} is a scalar type, | ||
otherwise by using an eligible trivial constructor. |
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.
“direct initialization” should be “direct-initialization”
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.
done
The function parameter or return object is initialized | ||
from the final temporary | ||
as if by direct initialization if \tcode{X} is a scalar type, | ||
otherwise by using an eligible trivial constructor. |
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.
“direct initialization” should be “direct-initialization”
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.
done
…e because that seems to be the consistent style in the standard, removed informational-only JMB comments
Fixes: #7655
Also Fixes: cplusplus/papers#1648
I have put comments in starting with JMB (my initials) where an editorial change was made due to minor mistakes in P2900 (missing comma, rebasing, etc.) as well as some places where I think we should have additional xrefs.
This is also based on the changes for P1494 (#7681) as we modify a paragraph added there. That should certainly merge first, and I will keep this PR rebased on it.