-
Notifications
You must be signed in to change notification settings - Fork 10.6k
Fix errors and warnings building swift/serialization on Windows with MSVC #6024
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
Conversation
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.
MSVC really doesn't support sizeof(value) in a static_assert?
Let's call it ModuleBits, I guess…
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.
It doesn't seem to support sizeof(value) well in many places. It's always happy with sizeof(TypeName) though...
I've renamed the struct as you suggested.
|
@swift-ci Please smoke test and merge |
|
Strange CI error? looks like tests passed but ci couldn't merge |
| class Serialized { | ||
| private: | ||
| using RawBitOffset = decltype(DeclTypeCursor.GetCurrentBitNo()); | ||
| using RawBitOffset = uint64_t; |
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.
Very strange bug - only occurs with nested generic classes - https://connect.microsoft.com/VisualStudio/feedback/details/3116520
| unsigned : 0; | ||
| } Bits = {}; | ||
| static_assert(sizeof(Bits) <= 8, "The bit set should be small"); | ||
| static_assert(sizeof(ModuleBits) <= 8, "The bit set should be small"); |
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.
decltype()when its used as a return type in an operator. Fixed by replacing thedecltypewithuint64_tsizeof(instance). Fixed by usingsizeof(structType)instead