mirror of
https://github.com/Kitware/CMake.git
synced 2026-02-21 14:40:26 -06:00
Avoid compiling CMake itself as C++17 with Clang's MSVC ABI
GUID functions in ATL cause compilation errors with this compiler. Add the offending case to our check for C++17 support so that it is not used by default when it does not work.
This commit is contained in:
@@ -2,8 +2,21 @@
|
||||
#include <memory>
|
||||
#include <unordered_map>
|
||||
|
||||
#ifdef _MSC_VER
|
||||
# include <comdef.h>
|
||||
#endif
|
||||
|
||||
int main()
|
||||
{
|
||||
std::unique_ptr<int> u(new int(0));
|
||||
|
||||
#ifdef _MSC_VER
|
||||
// clang-cl has problems instantiating this constructor in C++17 mode
|
||||
// error: indirection requires pointer operand ('const _GUID' invalid)
|
||||
// return *_IID;
|
||||
IUnknownPtr ptr{};
|
||||
IDispatchPtr disp(ptr);
|
||||
#endif
|
||||
|
||||
return *u;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user