[libcxx-commits] [libcxx] [libc++] Add default copy ctor to "__chrono/exception.h" (PR #95338)

via libcxx-commits libcxx-commits at lists.llvm.org
Wed Jun 12 18:52:59 PDT 2024


https://github.com/zeroomega updated https://github.com/llvm/llvm-project/pull/95338

>From 5fb1497990d3171d0cb6167574436ed9d8f20779 Mon Sep 17 00:00:00 2001
From: Haowei Wu <haowei at google.com>
Date: Wed, 12 Jun 2024 17:33:23 -0700
Subject: [PATCH] [libc++] Add default copy ctor to "__chrono/exception.h"

After PR#90394, "__chrono/exception.h" will trigger
"deprecated-copy-with-user-provided-dtor" warning on Windows x64
runtime testing with ToT Clang. This patch addresses this issue by
explicitly adding those default copy ctors.
---
 libcxx/include/__chrono/exception.h | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libcxx/include/__chrono/exception.h b/libcxx/include/__chrono/exception.h
index 75fd0615b7e08..fe3619ca22f8c 100644
--- a/libcxx/include/__chrono/exception.h
+++ b/libcxx/include/__chrono/exception.h
@@ -48,6 +48,9 @@ class nonexistent_local_time : public runtime_error {
                             "creating an nonexistent_local_time from a local_info that is not non-existent");
   }
 
+  nonexistent_local_time(const nonexistent_local_time&)            = default;
+  nonexistent_local_time& operator=(const nonexistent_local_time&) = default;
+
   _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~nonexistent_local_time() override; // exported as key function
 
 private:
@@ -89,6 +92,9 @@ class ambiguous_local_time : public runtime_error {
                             "creating an ambiguous_local_time from a local_info that is not ambiguous");
   }
 
+  ambiguous_local_time(const ambiguous_local_time&)            = default;
+  ambiguous_local_time& operator=(const ambiguous_local_time&) = default;
+
   _LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~ambiguous_local_time() override; // exported as key function
 
 private:



More information about the libcxx-commits mailing list