brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · 90cf99d Raw
38 lines · cpp
1//===----------------------------------------------------------------------===//2//3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.4// See https://llvm.org/LICENSE.txt for license information.5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception6//7//===----------------------------------------------------------------------===//8 9// UNSUPPORTED: c++03, c++11, c++14, c++1710// UNSUPPORTED: no-filesystem, no-localization, no-tzdb11 12// XFAIL: libcpp-has-no-experimental-tzdb13// XFAIL: availability-tzdb-missing14 15// <chrono>16 17// struct leap_second_info {18//   bool    is_leap_second;19//   seconds elapsed;20// };21 22#include <chrono>23#include <type_traits>24 25// Validates whether:26// - The members are present as non-const members.27// - The struct is an aggregate.28int main(int, const char**) {29  static_assert(std::is_aggregate_v<std::chrono::leap_second_info>);30 31  std::chrono::leap_second_info leap_second_info{.is_leap_second = false, .elapsed = std::chrono::seconds(0)};32 33  [[maybe_unused]] bool& is_leap_second          = leap_second_info.is_leap_second;34  [[maybe_unused]] std::chrono::seconds& elapsed = leap_second_info.elapsed;35 36  return 0;37}38