Fix build using GCC#28
Conversation
C++ disallows referring to the return type of a class member function with the same name as the function itself, but only GCC produces an error for it. It can be easily fixed by specifying the namespace in the return type.
`impl/winmd_reader/view.h` uses `std::exchange`. Without the include, it fails to build on GCC 12 / libstdc++.
|
Unfortunately, there's currently no CI build for this repo. We need to validate the change in cppwinrt before merging. |
|
Historically, the winmd reader was just a part of cppwinrt but then some other projects wanted to use it and here we are. It's a bit more work this way unfortunately. |
|
No problem, it is tested in the checks of this PR: microsoft/cppwinrt#1239 |
|
Ran into some issues publishing the nuget package for this project. It may be simpler just to roll this into the cppwinrt repo (where it originated) and avoid the nuget dependency... |
|
These changes only affects building with GCC, so only the CMake build of cppwinrt will need the update. We can have the CMake build clone the latest source from this repo instead of downloading the nuget package. MSVC and Clang don't require these changes, so the VS project can continue to use the current winmd nuget dependency. This way we don't need to vendor the winmd headers into the cppwinrt repo. Does this sound good to you? |
|
Sounds good. cc @DefaultRyan in case he knows how to get the nuget package updated. |
The first commit fixes warnings like the following when compiled on Linux GCC:
(See also: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=41039, https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1697r0.html)
The second commit fixes #27.