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

P0619R4 Review of deprecated facilities #2210

Merged
merged 9 commits into from Jun 25, 2018
Merged

Conversation

zygoloid
Copy link
Member

Fixes #2144

@zygoloid zygoloid force-pushed the motions-2018-06-lwg-27 branch 2 times, most recently from e45db95 to 91112c9 Compare June 23, 2018 01:36
@zygoloid zygoloid requested a review from tkoeppe June 23, 2018 01:36
@zygoloid
Copy link
Member Author

@tkoeppe Can you review this please, particularly the synopses for the C headers left behind by the removal of the five C++ headers?

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 23, 2018

Looking.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 23, 2018

The initial commit message is missing the revision number of the paper.

Are you going to squash some of the amendment commits?

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 23, 2018

Re [diff.cpp17.library]p2: I don't want to rain on anyone's parade, but if my program depends on __alignas_is_defined, I can't just remove an inclusion of <cstdalign> without change in behaviour, can I? But maybe that's not worth calling out.

Perhaps a slightly longer migration strategy could be advised: <cstdalign> can simply be removed, unless the macro __alignas_is_defined is needed, in which case <stdalign.h> should be included instead.

Valid \CppIII{} code that replaces the global replaceable \tcode{operator new}
is ill-formed in this International Standard,
because the exception specification of \tcode{throw(std::bad_alloc)}
was removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

Add a cross-reference to the Annex C entry describing the removal?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is the Annex C entry describing the removal.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh, sorry, I somehow thought this should refer to the removal of dynamic exception specifications or of throw(), but you're right, that's not what matters here.

\tcode{<ciso646>},
\tcode{<cstdalign>}, or
\tcode{<cstdbool>}
can simply be removed.
Copy link
Contributor

Choose a reason for hiding this comment

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

(See comment on the main thread regarding the macros in the last two headers.)

Copy link
Member Author

Choose a reason for hiding this comment

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

Technically, any code using the __* macros is ill-formed (no diagnostic required) by [lex.name]p3.

Copy link
Contributor

Choose a reason for hiding this comment

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

Errr... unless we specify a name, right? We do specify things like __func__, which are not UB to use.

Copy link
Member Author

@zygoloid zygoloid Jun 24, 2018

Choose a reason for hiding this comment

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

some identifiers are reserved for use by C++ implementations and shall not be used otherwise; no diagnostic is required. [...] Each identifier that contains a double underscore __ or begins with an underscore followed by an uppercase letter is reserved to the implementation for any use.

... sure suggests to me that using __func__ is ill-formed, no diagnostic required. Sounds like we need a core issue.

Copy link
Contributor

Choose a reason for hiding this comment

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

And what about __cplusplus and SD-6 feature test macros?

Copy link
Contributor

Choose a reason for hiding this comment

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

@zygoloid: That cannot be the right reading. Not only do we have many macros with specified meaning, but also consider that C, which has similar wording, regularly introduces new keywords that use reserved names. It must be possible for the standard to specify names like that.

\tcode{<stdint.h>} &
\tcode{<uchar.h>} & \\
\pnum
The header \tcode{<ctgmath>}
Copy link
Contributor

Choose a reason for hiding this comment

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

Wait, this is weird -- why are we talking about <ctgmath> in the synopsis of <tgmath.h>?

Copy link
Member Author

Choose a reason for hiding this comment

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

Oops, missed this one. Fixed.

@zygoloid
Copy link
Member Author

To do once approved: merge fixup commit into previous commit, reword first commit message to include paper revision number.

@tkoeppe I wasn't planning on flattening any of the commits here other than the one named 'fixup'. Let me know if there are more that you think should be folded together.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 24, 2018

@zygoloid: OK, I think it's fine to keep the commits. There are lots, but I suppose that's reflective of the challenging nature of this motion.

@zygoloid zygoloid changed the title P0619 Review of deprecated facilities P0619R4 Review of deprecated facilities Jun 25, 2018
AlisdairM and others added 9 commits June 24, 2018 23:39
emphasize relationship between it and the converting constructors.
longer a possible change.

It is not possible to write a global replacement operator new or
operator delete in C++20 with code that is also valid C++03, because

a) operator new must be declared 'throw(std::bad_alloc)' in C++03 and
   must be declared with no exception specification in C++11 onwards,
and
b) operator delete must be declared 'throw()' in C++03 and must be
   declared 'noexcept' in C++20 onwards.

Therefore there is no code that is valid in C++03 and C++20 and changes
meaning due to the change identified in this section.

Instead, expand [diff.cpp03.language.support]p2 to explain that the
affected programs are simply not valid in C++20.
code that is non-throwing in both C++20 and C++03.
"This was retained for one additional C++ standard to ease transition"
is not a rationale for removing the feature now.
<cstdalign>, <cstdbool>, and <ctgmath>.

Instead, repurpose these to be synopses for <complex.h>, <stdalign.h>,
<stdbool.h>, and <tgmath.h>, and move them into [depr.c.headers].
Also introduce a synopsis for <iso646.h>.

This avoids three of these five headers being specified as equivalent to
a non-existent <cfoo> header, and the other two missing a synopsis.
@zygoloid zygoloid merged commit 04eb7aa into master Jun 25, 2018
@jensmaurer jensmaurer deleted the motions-2018-06-lwg-27 branch October 19, 2019 20:04
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