summaryrefslogtreecommitdiff
path: root/bootstrap
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-08-26 14:30:58 +0000
committerKitware Robot <kwrobot@kitware.com>2019-08-26 10:31:15 -0400
commitf5a7ae0c4bcfa90fb530d69f9277290c5f947db2 (patch)
treed9955bc2c992102093f309cab04e2cfeaf716f9d /bootstrap
parent4892f73d7428fbbe4bd11d4892590ec81eeff56b (diff)
parent197c5e12adea2b7d72cf8bfa17e961b9428f5d57 (diff)
downloadcmake-f5a7ae0c4bcfa90fb530d69f9277290c5f947db2.tar.gz
Merge topic 'optional'
197c5e12ad Source: Add cm::optional 170fcd715f Extend C++17 feature checks to require std::optional Acked-by: Kitware Robot <kwrobot@kitware.com> Acked-by: Sebastian Holtermann <sebholt@web.de> Merge-request: !3644
Diffstat (limited to 'bootstrap')
-rwxr-xr-xbootstrap16
1 files changed, 15 insertions, 1 deletions
diff --git a/bootstrap b/bootstrap
index eaccfc89c1..42503e3b42 100755
--- a/bootstrap
+++ b/bootstrap
@@ -1147,6 +1147,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:
@@ -1157,7 +1171,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"