aboutsummaryrefslogtreecommitdiff
path: root/libcxx
diff options
context:
space:
mode:
authorEric Fiselier <eric@efcs.ca>2016-07-01 23:22:25 +0000
committerEric Fiselier <eric@efcs.ca>2016-07-01 23:22:25 +0000
commitd3a1ed814b8fa0af7277fb02a6037223aec98371 (patch)
tree5cf9dc841f93cd8aa7bdac5ac74d302ab381e164 /libcxx
parent28aaf45c1056e76c26a2c738755bc964e0380b4f (diff)
downloadllvm-d3a1ed814b8fa0af7277fb02a6037223aec98371.zip
llvm-d3a1ed814b8fa0af7277fb02a6037223aec98371.tar.gz
llvm-d3a1ed814b8fa0af7277fb02a6037223aec98371.tar.bz2
Work around ABI break caused by C++17 inline variables.
llvm-svn: 274403
Diffstat (limited to 'libcxx')
-rw-r--r--libcxx/src/chrono.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/libcxx/src/chrono.cpp b/libcxx/src/chrono.cpp
index 62149fb..14b848b 100644
--- a/libcxx/src/chrono.cpp
+++ b/libcxx/src/chrono.cpp
@@ -6,7 +6,7 @@
// Source Licenses. See LICENSE.TXT for details.
//
//===----------------------------------------------------------------------===//
-
+#define _LIBCPP_BUILDING_CHRONO
#include "chrono"
#include "cerrno" // errno
#include "system_error" // __throw_system_error
@@ -32,6 +32,9 @@ namespace chrono
// system_clock
const bool system_clock::is_steady;
+// Make is_steady non-discardable in C++17
+// See PR28395 (https://llvm.org/bugs/show_bug.cgi?id=28395)
+static const bool& __is_steady_force_use1 __attribute__((used)) = system_clock::is_steady;
system_clock::time_point
system_clock::now() _NOEXCEPT
@@ -68,6 +71,10 @@ system_clock::from_time_t(time_t t) _NOEXCEPT
// instead.
const bool steady_clock::is_steady;
+// Make is_steady non-discardable in C++17
+// See PR28395 (https://llvm.org/bugs/show_bug.cgi?id=28395)
+static const bool& __is_steady_force_use2 __attribute__((used)) = steady_clock::is_steady;
+
#ifdef CLOCK_MONOTONIC