Skip to content

Commit 8b9dce3

Browse files
authored
[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.
1 parent c0cba51 commit 8b9dce3

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

libcxx/include/__chrono/exception.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,9 @@ class nonexistent_local_time : public runtime_error {
4848
"creating an nonexistent_local_time from a local_info that is not non-existent");
4949
}
5050

51+
_LIBCPP_HIDE_FROM_ABI nonexistent_local_time(const nonexistent_local_time&) = default;
52+
_LIBCPP_HIDE_FROM_ABI nonexistent_local_time& operator=(const nonexistent_local_time&) = default;
53+
5154
_LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~nonexistent_local_time() override; // exported as key function
5255

5356
private:
@@ -89,6 +92,9 @@ class ambiguous_local_time : public runtime_error {
8992
"creating an ambiguous_local_time from a local_info that is not ambiguous");
9093
}
9194

95+
_LIBCPP_HIDE_FROM_ABI ambiguous_local_time(const ambiguous_local_time&) = default;
96+
_LIBCPP_HIDE_FROM_ABI ambiguous_local_time& operator=(const ambiguous_local_time&) = default;
97+
9298
_LIBCPP_AVAILABILITY_TZDB _LIBCPP_EXPORTED_FROM_ABI ~ambiguous_local_time() override; // exported as key function
9399

94100
private:

0 commit comments

Comments
 (0)