summaryrefslogtreecommitdiff
path: root/Source/Checks
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-22 08:28:08 -0400
committerBrad King <brad.king@kitware.com>2019-08-23 08:43:35 -0400
commit170fcd715f586cfd6b9f741c0572d472e0abe8ed (patch)
treecb76e69494bb4f043eddf8c4e2267a073286451a /Source/Checks
parent43fe736b2bf272647fb24b481bdc9a585c0666ac (diff)
downloadcmake-170fcd715f586cfd6b9f741c0572d472e0abe8ed.tar.gz
Extend C++17 feature checks to require std::optional
Diffstat (limited to 'Source/Checks')
-rw-r--r--Source/Checks/cm_cxx17_check.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Checks/cm_cxx17_check.cpp b/Source/Checks/cm_cxx17_check.cpp
index 593d9b263d..29863b136b 100644
--- a/Source/Checks/cm_cxx17_check.cpp
+++ b/Source/Checks/cm_cxx17_check.cpp
@@ -1,6 +1,7 @@
#include <cstdio>
#include <iterator>
#include <memory>
+#include <optional>
#include <unordered_map>
#ifdef _MSC_VER
@@ -27,5 +28,7 @@ int main()
IDispatchPtr disp(ptr);
#endif
- return *u + *ai + *(bi - 1) + (3 - static_cast<int>(ci));
+ std::optional<int> oi = 0;
+
+ return *u + *ai + *(bi - 1) + (3 - static_cast<int>(ci)) + oi.value();
}