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

friend [[nodiscard]] #6052

Closed
notbob-at-tessellation-com opened this issue Jan 18, 2023 · 5 comments
Closed

friend [[nodiscard]] #6052

notbob-at-tessellation-com opened this issue Jan 18, 2023 · 5 comments

Comments

@notbob-at-tessellation-com

Hello,

Today I am making my first posts to this group. Please forgive me if I make mistakes. Thank you.

Here is the context:

Header <stop_token>:

[[nodiscard]] friend bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;

I would have thought that this should be:

friend [[nodiscard]] bool operator==(const stop_token& lhs, const stop_token& rhs) noexcept;

i.e. the attribute pertains to the function, not to the friend declaration,
but I was told that an attribute cannot appear in this position,
hence it must be as it is in <stop_token>.

Perhaps the grammar should be amended to allow an attribute in this position?

What do you think?

Thank you,

Robert Schwartz

@jwakely
Copy link
Member

jwakely commented Jan 18, 2023

@jwakely jwakely closed this as not planned Won't fix, can't repro, duplicate, stale Jan 18, 2023
@notbob-at-tessellation-com
Copy link
Author

@jwakely
Copy link
Member

jwakely commented Jan 18, 2023

std-discussion makes sense, I think.

@notbob-at-tessellation-com
Copy link
Author

@jensmaurer
Copy link
Member

Please read https://isocpp.org/std/submit-a-proposal
and be prepared to offer rationale why we need another round of complication of the "stuff before the declarator-id" in a declaration.

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

No branches or pull requests

3 participants