summaryrefslogtreecommitdiffstats
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-22 12:28:08 (GMT)
committerBrad King <brad.king@kitware.com>2019-08-23 12:43:35 (GMT)
commit170fcd715f586cfd6b9f741c0572d472e0abe8ed (patch)
treecb76e69494bb4f043eddf8c4e2267a073286451a /bootstrap
parent43fe736b2bf272647fb24b481bdc9a585c0666ac (diff)
downloadCMake-170fcd715f586cfd6b9f741c0572d472e0abe8ed.zip
CMake-170fcd715f586cfd6b9f741c0572d472e0abe8ed.tar.gz
CMake-170fcd715f586cfd6b9f741c0572d472e0abe8ed.tar.bz2
Extend C++17 feature checks to require std::optional
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap16
1 files changed, 15 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index 4581239..17dc3e8 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1146,6 +1146,20 @@ int check_cxx14()
}
#endif
+#if __cplusplus >= 201703L
+#include <optional>
+int check_cxx17()
+{
+ std::optional<int> oi = 0;
+ return oi.value();
+}
+#else
+int check_cxx17()
+{
+ return 0;
+}
+#endif
+
class Class
{
public:
@@ -1156,7 +1170,7 @@ private:
int main()
{
auto const c = std::unique_ptr<Class>(new Class);
- std::cout << c->Get() << check_cxx14() << std::endl;
+ std::cout << c->Get() << check_cxx14() << check_cxx17() << std::endl;
return 0;
}
' > "${TMPFILE}.cxx"