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

[depr.c.macros] Missing description of __alignof_is_defined LWG4036 #6765

Closed
frederick-vs-ja opened this issue Jan 11, 2024 · 8 comments · Fixed by #6915
Closed

[depr.c.macros] Missing description of __alignof_is_defined LWG4036 #6765

frederick-vs-ja opened this issue Jan 11, 2024 · 8 comments · Fixed by #6915
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.

Comments

@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Jan 11, 2024

__alignas_is_defined and __alignof_is_defined are introduced in C11 (WG14 N1507, WG14 N1558) and removed in C23 (WG14 N2934).

However, C++ (11~23) has never mentioned __alignof_is_defined even though it's specified that "contents of the C++ header <stdalign.h> are the same as the C standard library header <stdalign.h>" (the wording was slightly different before C++20). There doesn't seem any C++ paper or issue for this.

Is it intended that __alignof_is_defined is not a C++ feature or is there a missing specification? In the latter case, we may still need to change Annex C for C++26.

@jwakely
Copy link
Member

jwakely commented Jan 11, 2024

This was mentioned during the discussion of LWG 3827 but looks like it didn't make it into the issue.

It was mentioned in cplusplus/nbballot#502

It doesn't really matter now, because if it was supposed to be present in older standards, it's gone now anyway. I don't think we want a compatibility note saying that something which was never in the standard is gone now.

@jwakely
Copy link
Member

jwakely commented Jan 11, 2024

Oh wait, they're not gone, we only deprecated them for now. Sigh.

I suppose we could add __alignof_is_defined to Annex D. I find it hard to care. Nobody should ever try to use that macro in C++.

@jensmaurer
Copy link
Member

What's unclear about this specification in [stdalign.h.syn] ?

The contents of the C++ header <stdalign.h> are the same as the C standard library header <stdalign.h>, with the following changes: The header <stdalign.h> does not define a macro named alignas.
See also: ISO/IEC 9899:2018, 7.15

Our normative reference is to C17, so if this has a macro in <stdalign.h>, then C++23 has this macro as well.

What exactly is the problem? Do you want index entries for the macros?

@jwakely
Copy link
Member

jwakely commented Jan 11, 2024

We explicitly deprecated __alignas_is_defined in C++23, it would be silly to leave __alignof_is_defined there, un-deprecated. It would conflict with the clear direction of an NB comment.

@jensmaurer
Copy link
Member

jensmaurer commented Jan 11, 2024

Ah, ok, we're simply missing an entry for __alignof_is_defined in [depr.c.macros].

@jwakely , do you feel we should do that editorially, or is that an LWG matter? Strictly speaking, it's normatively deprecating a macro whose status quo is that it's not deprecated.

@jwakely
Copy link
Member

jwakely commented Jan 11, 2024

Yeah I think we should probably do it as an LWG issue. I don't know why it was never listed in the contents of <cstdalign>, if it had been there, we'd have deprecated it as part of LWG 3827.

@jensmaurer jensmaurer added lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking. labels Jan 11, 2024
@frederick-vs-ja
Copy link
Contributor Author

frederick-vs-ja commented Jan 12, 2024

Hmm... I'm tried to submit an LWG issue but not sure whether it is wanted (it's possibly too late). Since C++26 will probably refer to C23 and thus should get __alignas_is_defined/__alignof_is_defined removed.

That's now LWG4036.

@frederick-vs-ja frederick-vs-ja changed the title [depr.c.macros] Missing description of __alignof_is_defined [depr.c.macros] Missing description of __alignof_is_defined LWG4036 Jan 14, 2024
@frederick-vs-ja
Copy link
Contributor Author

Should be fixed by #6915.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lwg Issue must be reviewed by LWG. not-editorial Issue is not deemed editorial; the editorial issue is kept open for tracking.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants