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

[expr.static.cast] Remove unused cv-qualifier notation #3937

Merged
merged 1 commit into from Oct 18, 2020

Conversation

sdkrystian
Copy link
Contributor

No description provided.

@W-E-Brown
Copy link
Contributor

This excision seems wrong, as it would disallow conversions that are now permitted. At the least, it seems non-editorial.

@sdkrystian
Copy link
Contributor Author

@W-E-Brown How so? Given a type const int, it can be represented as T, where T is const int, or cv T, where cv is const and T is int.

The only context where this would present any kind of questionable difference is:

If T2 is an inaccessible or ambiguous base class of T1, a program that necessitates such a cast is ill-formed.

However, we ignore cv-qualifiers in the determination of if a type B is a base class of D, so there would be no difference in effect.

@W-E-Brown
Copy link
Contributor

That argument is beyond me. Fewer words does not always produce a better specification.

We routinely go out of our way to indicate when a rule applies to a possibly cv-qualified type. The proposed change seems to go in the other direction and thus obscures, rather than illuminates.

@sdkrystian
Copy link
Contributor Author

We use the cv notation when we need to establish constraints based what they are, (e.g. the cv-qualification must be the same, or cv1 must be less cv-qualified than cv2). If anything, using the cv notation and then not using the resulting "variables" we introduce is more confusing, since we generally only use the notation when we care about the cv-qualification. Personally, when I see cv I automatically assume that it will be used to enforce a restriction.

reference to \cvqual{cv2} \tcode{T2}'' if ``\cvqual{cv2} \tcode{T2}'' is
reference-compatible with ``\cvqual{cv1}
\tcode{T1}''\iref{dcl.init.ref}. If the value is not a bit-field,
of type \tcode{T1} can be cast to type ``rvalue
Copy link
Member

Choose a reason for hiding this comment

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

We could say "An lvalue of (possibly cv-qualified) type T1 ... " to address Walter's concerns. But it's harder to fit in the "possibly cv-qualified" for T2. I do agree with the intent here that we only write "cv T" if we want to talk about "cv" separately.

@zygoloid zygoloid added this to the C++23 milestone Sep 18, 2020
@zygoloid zygoloid merged commit 0c95d56 into cplusplus:master Oct 18, 2020
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

4 participants