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

via libcxx-commits libcxx-commits at lists.llvm.org
Fri Jun 14 09:37:29 PDT 2024


Author: Haowei
Date: 2024-06-14T12:37:26-04:00
New Revision: 8b9dce333f71bc21b3534e89a41e1ea8672aa063

URL: https://github.com/llvm/llvm-project/commit/8b9dce333f71bc21b3534e89a41e1ea8672aa063
DIFF: https://github.com/llvm/llvm-project/commit/8b9dce333f71bc21b3534e89a41e1ea8672aa063.diff

LOG: [libc++] Add default copy ctor to "__chrono/exception.h" (#95338)

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.

It is a bit weird that the same warning will not happen when testing on
Linux x64 under the same condition, despite the warning flag was enabled
(with `-Wdeprecated-copy -Wdeprecated-copy-dtor`). It might be a bug.

Added: 
    

Modified: 
    libcxx/include/__chrono/exception.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__chrono/exception.h b/libcxx/include/__chrono/exception.h
index 75fd0615b7e08..266f8fac44176 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");
   }
 
+  _LIBCPP_HIDE_FROM_ABI nonexistent_local_time(const nonexistent_local_time&)            = default;
+  _LIBCPP_HIDE_FROM_ABI 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");
   }
 
+  _LIBCPP_HIDE_FROM_ABI ambiguous_local_time(const ambiguous_local_time&)            = default;
+  _LIBCPP_HIDE_FROM_ABI 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