summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorZsolt Parragi <zsolt.parragi@cancellar.hu>2018-11-06 20:40:18 +0100
committerZsolt Parragi <zsolt.parragi@cancellar.hu>2019-02-11 15:04:19 +0100
commitd625dfcdf9ad36802d0615cd929dd5c407a46524 (patch)
treedecd49268197d62be0f5f5a4b61ea3b85a5e8c03 /Source/Checks
parent8a1d25afdf92cabab88598cc9b9e5a9fb2a9493b (diff)
downloadcmake-d625dfcdf9ad36802d0615cd929dd5c407a46524.tar.gz
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.
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx17_check.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp
index 4e8918454a..2de10d604e 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -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;
}