File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed
tests/std/tests/GH_001638_dllexport_derived_classes Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -582,6 +582,7 @@ public:
582582 }
583583
584584#if _HAS_CXX23
585+ template <int = 0> // see GH-3013
585586 constexpr void swap(const tuple& _Right) const
586587 noexcept(conjunction_v<is_nothrow_swappable<const _This>, is_nothrow_swappable<const _Rest>...>) {
587588 _Swap_adl(_Myfirst._Val, _Right._Myfirst._Val);
Original file line number Diff line number Diff line change @@ -329,6 +329,7 @@ struct pair { // store a pair of values
329329 }
330330
331331#if _HAS_CXX23
332+ template <int = 0> // see GH-3013
332333 constexpr void swap(const pair& _Right) const
333334 noexcept(is_nothrow_swappable_v<const _Ty1>&& is_nothrow_swappable_v<const _Ty2>) {
334335 if (this != _STD addressof(_Right)) {
Original file line number Diff line number Diff line change 99#include < queue>
1010#include < set>
1111#include < stack>
12+ #include < tuple>
1213#include < unordered_map>
1314#include < unordered_set>
15+ #include < utility>
1416#include < vector>
1517
1618#if _HAS_CXX20
@@ -50,3 +52,7 @@ struct __declspec(dllexport) ExportedStack : stack<int> {};
5052struct __declspec (dllexport) ExportedSpan : span<int > {};
5153struct __declspec (dllexport) ExportedSpanThree : span<int , 3 > {};
5254#endif // _HAS_CXX20
55+
56+ // Test GH-3013 "<utility>: pair::swap(const pair&) interacts badly with __declspec(dllexport)"
57+ struct __declspec (dllexport) ExportedPair : pair<int , int > {};
58+ struct __declspec (dllexport) ExportedTuple : tuple<int , int , int > {};
You can’t perform that action at this time.
0 commit comments