-
Notifications
You must be signed in to change notification settings - Fork 967
Document C2323 #4993
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
Document C2323 #4993
Conversation
@Rageking8 : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Learn Build status updates of commit e82960a: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
PRMerger Results
|
@Rageking8 : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
small edits
tiny little edit
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Rageking8, thank you very much for all your contributions. I really value the improvements you are making!
Learn Build status updates of commit 8c9ee12: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
PRMerger Results
|
#sign-off |
Learn Build status updates of commit f055e78: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
PRMerger Results
|
--- | ||
# Compiler Error C2323 | ||
|
||
'identifier': non-member operator `new` or `delete` functions may not be declared `static` or in a namespace other than the global namespace. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should keywords in error messages have backticks or be shown verbatim (raw with no backticks)? Since what I commonly see is the latter.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The goal is to prevent machine translation. We weren't good about this and got complaints about crazy machine translations for things that shouldn't be translated in the first place. So, we started adding the back ticks.
|
||
'identifier': non-member operator `new` or `delete` functions may not be declared `static` or in a namespace other than the global namespace. | ||
|
||
The `new` and `delete` overload operators must be non-static, defined in the global namespace or as class members. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To be more precise it should be "operator overloads" and not "overload operators".
In addition, with the placement of the comma, one possible misinterpretation of the sentence is that new
/delete
operator overloads which are class members must be non-static. That is false as those can be declared static
and even if the static
keyword is not explicitly used, it is always a static
member.
I will address these issues in a follow-up PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's cool. It was just a bit verbose before.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we can split it into 2 lines, one for the case where it is in the global namespace (emphasis on must be non-static), and the other is for class members (emphasis on optional static
keyword and it being always static
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea
Create dedicated page for error C2323.