-
Notifications
You must be signed in to change notification settings - Fork 263
Improve classic COM support, and improve diagnostic for common error #1022
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
Changes from all commits
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 |
|---|---|---|
|
|
@@ -118,12 +118,14 @@ namespace winrt::impl | |
| }; | ||
|
|
||
| template <typename T> | ||
| #ifdef WINRT_IMPL_IUNKNOWN_DEFINED | ||
| #ifdef __clang__ | ||
| #if defined(__clang__) | ||
| #if __has_declspec_attribute(uuid) | ||
|
Collaborator
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. Can't believe Clang still doesn't treat
Contributor
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. It should, I reported a bug back in 2018 and that bug was fixed in 2020: https://bugs.llvm.org/show_bug.cgi?id=38490
Member
Author
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. Cool! Now to figure out how to detect this bugfix at compile time. Any clues? (Or is it okay to require everyone to have a fixed clang?)
Collaborator
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. Assuming this fix has been published, I would be ok with just requiring it. Older compilers can just stick with an older version of C++/WinRT.
Contributor
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. We can version detect or use something to check if an expression is constexpr, but Clang 11 is almost 1 year old so I'm not sure how much it's worth to support older. VS seems to require (or strongly suggest) an up to date clang to be able to use the LLVM platform toolset so I imagine the amount of consumers of cppwinrt with an out of date clang to be somewhat low.
Member
Author
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. Sadly, godbolt's clang hasn't been updated with the fix. Also sadly, the compile-time detection lets you change code flow based on whether something is constexpr-evaluatable, but I don't see how you can use it to change whether a variable is constexpr.
Collaborator
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. Too bad - looks like its not been fixed after all.
Contributor
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 is weird, it works on my local copy of Clang 12 (we get to the link stage, and that fails cause I didn't add a The version of clang on Godbolt runs on Linux - this might be related. |
||
| inline const guid guid_v{ __uuidof(T) }; | ||
| #else | ||
| inline constexpr guid guid_v{ __uuidof(T) }; | ||
| inline constexpr guid guid_v{}; | ||
| #endif | ||
| #elif defined(_MSC_VER) | ||
| inline constexpr guid guid_v{ __uuidof(T) }; | ||
| #else | ||
| inline constexpr guid guid_v{}; | ||
| #endif | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1 +1,2 @@ | ||
| #pragma once | ||
| #include <unknwn.h> // Nested.HierarchyD uses classic COM interface IReferenceTrackerExtension |
Uh oh!
There was an error while loading. Please reload this page.