Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<xmemory>: some std::allocator member functions still need to be removed in C++20 #1445

Closed
mnatsuhara opened this issue Nov 11, 2020 · 1 comment · Fixed by #1585
Closed
Labels
bug Something isn't working fixed Something works now, yay!

Comments

@mnatsuhara
Copy link
Contributor

std::allocator member functions address, max_size, construct, and destroy, should be removed in C++20 mode according to WG21-P0619. Most of the removals in this paper were completed by GH-380, but these seem to have been missed.

@mnatsuhara mnatsuhara added bug Something isn't working cxx20 C++20 feature labels Nov 11, 2020
@StephanTLavavej StephanTLavavej removed the cxx20 C++20 feature label Nov 11, 2020
@StephanTLavavej
Copy link
Member

Removing the cxx20 label which tracks top-level features and controls the Status Chart (when it appears on issues, unlike PRs).

This will probably have some amount of source-breaking impact, but that should be mitigated by:

  • These were deprecated in C++17 and we've been emitting warnings
  • The STL itself should always be going through allocator_traits (and indeed we had to internally suppress deprecation warnings, because allocator_traits will use these member functions when present), so it should auto-adapt to the member functions vanishing
  • A fine-grained escape hatch connected to our coarse-grained escape hatch will allow projects to opt-out of the removal, if they were previously suppressing or ignoring the deprecation warning

The escape hatch system is:

STL/stl/inc/yvals_core.h

Lines 1012 to 1047 in 9959929

// P0619R4 Removing C++17-Deprecated Features
#ifndef _HAS_FEATURES_REMOVED_IN_CXX20
#define _HAS_FEATURES_REMOVED_IN_CXX20 (!_HAS_CXX20)
#endif // _HAS_FEATURES_REMOVED_IN_CXX20
#ifndef _HAS_DEPRECATED_ADAPTOR_TYPEDEFS
#define _HAS_DEPRECATED_ADAPTOR_TYPEDEFS (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_ADAPTOR_TYPEDEFS
#ifndef _HAS_DEPRECATED_IS_LITERAL_TYPE
#define _HAS_DEPRECATED_IS_LITERAL_TYPE (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_IS_LITERAL_TYPE
#ifndef _HAS_DEPRECATED_NEGATORS
#define _HAS_DEPRECATED_NEGATORS (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_NEGATORS
#ifndef _HAS_DEPRECATED_RAW_STORAGE_ITERATOR
#define _HAS_DEPRECATED_RAW_STORAGE_ITERATOR (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_RAW_STORAGE_ITERATOR
#ifndef _HAS_DEPRECATED_RESULT_OF
#define _HAS_DEPRECATED_RESULT_OF (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_RESULT_OF
#ifndef _HAS_DEPRECATED_SHARED_PTR_UNIQUE
#define _HAS_DEPRECATED_SHARED_PTR_UNIQUE (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_SHARED_PTR_UNIQUE
#ifndef _HAS_DEPRECATED_TEMPORARY_BUFFER
#define _HAS_DEPRECATED_TEMPORARY_BUFFER (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_TEMPORARY_BUFFER
#ifndef _HAS_DEPRECATED_UNCAUGHT_EXCEPTION
#define _HAS_DEPRECATED_UNCAUGHT_EXCEPTION (_HAS_FEATURES_REMOVED_IN_CXX20)
#endif // _HAS_DEPRECATED_UNCAUGHT_EXCEPTION

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working fixed Something works now, yay!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants