From d625dfcdf9ad36802d0615cd929dd5c407a46524 Mon Sep 17 00:00:00 2001 From: Zsolt Parragi Date: Tue, 6 Nov 2018 20:40:18 +0100 Subject: 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. --- Source/Checks/cm_cxx17_check.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp index 4e89184..2de10d6 100644 --- a/Source/Checks/cm_cxx17_check.cpp +++ b/Source/Checks/cm_cxx17_check.cpp @@ -2,8 +2,21 @@ #include #include +#ifdef _MSC_VER +# include +#endif + int main() { std::unique_ptr 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; } -- cgit v0.12