-
Notifications
You must be signed in to change notification settings - Fork 70
Make the code compile with clang-cl in VS22 #888
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
base: main
Are you sure you want to change the base?
Changes from all commits
7e4fcf8
ff7b147
27a5509
df2bebe
8e33197
5fc4eee
f54b240
9167874
d141fe3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -32,7 +32,7 @@ | |
#define IUNKNOWN_NOEXCEPT | ||
#endif | ||
|
||
#if __cplusplus >= 201103L | ||
#if __cplusplus >= 201103L && !defined(__clang__) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This doesn't sit right with me, cland-cl should be able to handle these constructs in C++11 or greater. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I couldn't really figure out what was going on, frankly, I think clang-cl doesn't like forward declared enums with fixed underlying type, but that doesn't really make sense to me. |
||
#define CPP_11(code) code | ||
#else | ||
#define CPP_11(code) | ||
|
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.
Correct way to get a C string from StringClass is to use
static_cast<const char *>(name)
to invoke the conversion operator.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.
I'd like to hear from one or more other contributors on this because I think consistency is a valid counter point.
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.
static_cast<const char *>(name) is definitely better and we should refactor to it but not without also refactoring all other similar instances in the neighborhood. A following pull request for factoring would be more apt