Skip to content
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

Convert "must"s in normative wording that do not indicate logical #1747

Merged
merged 1 commit into from Sep 15, 2017

Conversation

zygoloid
Copy link
Member

necessity to a different form.

Normative requirements use "shall". Advice to users uses "should".
Description of the behavior of the implementation that does not of
itself constitute a requirement uses the imperative mood.

Fixes ISO 21 (C++17 DIS)

@tkoeppe
Copy link
Contributor

tkoeppe commented Sep 12, 2017

Check that whitespace!

@@ -583,18 +583,17 @@
id-expression
\end{bnf}

\begin{note}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this change relevant to the subject at hand?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think so. The below "name must be known to refer to a template" is supposed to be what normatively states what is and is not a template-name, but is hopelessly vague, and changing the "must" to a "shall" is also wrong -- the right thing is to say that an identifier is a template-name if name lookup associates it with one, which is what the note prior to the broken sentence says.

That said, I'd be happy to take a less-invasive alternate path through here.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's just leave this one alone for C++17. I'm now concerned that this sentence may be intended to have normative impact (eg, what else would make sizeof &operator""_foo < 8 > 0 parse as a comparison rather than as having a template-argument-list?)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

instantiation. In the case of a non-type template argument,
instantiation.
\begin{note}
In the case of a non-type template argument,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've discussed this recently for core issue 2307. Why is it safe to turn the normative text into a note here?

Copy link
Member Author

@zygoloid zygoloid Sep 12, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

N is not equivalent to, say, (N) per [temp.over.link]p5. But this wording is not particularly clear on whether [temp.over.link] is what we mean by "equivalent". Hmm.

I'm happy to make a different change if you'd prefer. Perhaps something more in this direction:

A template argument that is equivalent to a template parameter (i.e., has the same type as the template parameter or, for a non-type template argument, is an expression that names the template parameter but not as a subexpression) can be used in place of that template parameter in a reference to the current instantiation.

... but that's pretty awkward. Or perhaps:

A template argument that is equivalent to a template parameter (i.e., has the same constant value or the same type as the template parameter) can be used in place of that template parameter in a reference to the current instantiation. In the case of a non-type template argument, this only applies if the argument was given the value of the template parameter and not an expression in which the template parameter appears as a subexpression.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well, we don't really mean the "equivalent" from [temp.over.link] here: the example claims that my_I and I are "equivalent", but they are not the same per the ODR (i.e. token-by-token identical). So, we need the normative text to explain the different notion of "equivalent". [The very fact we're even discussing this makes me uneasy about such a large-ish last-minute change.]

That said, your second proposal above seems to be least invasive, so I'd prefer that.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

necessity to a different form.

Normative requirements use "shall". Advice to users uses "should".
Description of the behavior of the implementation that does not of
itself constitute a requirement uses the imperative mood.

Fixes ISO 21 (C++17 DIS)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants