[llvm-branch-commits] [libcxx] [libc++][chrono] Loads leap-seconds.list in tzdb. (PR #82113)

Louis Dionne via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Tue Feb 27 09:48:03 PST 2024


================
@@ -0,0 +1,53 @@
+// -*- C++ -*-
+//===----------------------------------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#ifndef SUPPORT_TEST_CHRONO_LEAP_SECOND_HPP
+#define SUPPORT_TEST_CHRONO_LEAP_SECOND_HPP
+
+/**
+ * @file Helper functions to create a @ref std::chrono::leap_second.
+ *
+ * Since the standard doesn't specify how a @ref std::chrono::leap_second is
+ * constructed this is implementation defined. To make the public API tests of
+ * the class generic this header defines helper functions to create the
+ * required object.
+ *
+ * @note This requires every standard library implementation to write their own
+ * helper function. Vendors are encouraged to create a pull request at
+ * https://github.com/llvm/llvm-project so their specific implementation can be
+ * part of this file.
+ */
+
+#include "test_macros.h"
+
+#if TEST_STD_VER < 20
+#  error "The format header requires at least C++20"
+#endif
+
+#include <chrono>
+
+#ifdef _LIBCPP_VERSION
+
+// In order to find this include the calling test needs to provide this path in
+// the search path. Typically this looks like:
+//   REMOVE_THIS_PREFIX__ADDITIONAL_COMPILE_FLAGS(stdlib=libc++): -I %S/../../../../../../src/include
----------------
ldionne wrote:

```suggestion
//   ADDITIONAL_COMPILE_FLAGS(stdlib=libc++): -I %S/../../../../../../src/include
```

This is not necessary to "escape" lit, since this is in a header.

https://github.com/llvm/llvm-project/pull/82113


More information about the llvm-branch-commits mailing list