-
Notifications
You must be signed in to change notification settings - Fork 967
Update C2345 #4741
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
Update C2345 #4741
Conversation
@Rageking8 : Thanks for your contribution! The author(s) have been notified to review your proposed change. |
Learn Build status updates of commit 24f8a1a: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
Can you review the proposed changes? When the changes are ready for publication, add a #label:"aq-pr-triaged" |
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.
Could you remove the align(0) example altogether? It's a strange beast because it's not a valid alignment (it's ignored). I tried VS 2022, 2019, 2017, and 2015 and none of them generate the C2345 compiler error. I wonder if that was an error by the original writer. At any rate, I like the other examples but would like to remove align(0) because it muddies the waters.
The spec, N4964 9.12.2 Alignment specifier [dcl.align]/p4 says:
“The alignment requirement of an entity is the strictest nonzero alignment specified by its alignment-specifiers, if any; otherwise, the alignment-specifiers have no effect.”
So let's not use that (align(0)) example.
Learn Build status updates of commit 47e0013: ✅ Validation status: passed
For more details, please refer to the build report. For any questions, please:
|
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.
Thank you!
#sign-off |
__declspec(align(0))
no longer generatesC2345
, added a high power of 2 to trigger the error.