This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Fix namespace versioning and remove __detail::__identity helpers


The begin/end versioned namespace macros are misplaced (or missing) in
<experimental/bits/erase_if.h> and <experimental/string_view> and
<string_view>, the latter of which introduces new ambiguities in C++17
mode.

This fixes that regression, and removes some unnecessary __identity<T>
helpers, as we can just use std::common_type<T> instead (which is
equivalent to decay<T> for these types, but using common_type of a
single type seems more expressive as an subsititute for the identity
transform).
	
       PR libstdc++/79243
	* include/bits/c++config (literals::string_view_literals::__7): Add.
	Only declare versioned namespaces for the relevant C++ dialects.
	* include/experimental/bits/erase_if.h (fundamentals_v2::__detail):
	Add versioning macros.
	* include/experimental/bits/lfts_config.h:
	(fundamentals_v1::__detail::__7, fundamentals_v2::__detail::__7): Add.
	* include/experimental/string_view (fundamentals_v2::__detail):
	Add versioning macros.
	(fundamentals_v2::__detail::__identity): Remove.
	(fundamentals_v2::__detail::__idt): Use common_type instead of
	__detail::__identity.
	* include/std/string_view (__detail::__identity, __detail::__idt):
	Likewise.
	(literals::string_view_literals): Fix nesting of versioning macros.

Tested x86_64-linux with versioned namespace, as c++{11,14,17}.
Tested powerpc64le-linux with normal namespace, as c++{11,14,17}.

There are a couple of pre-existing test failures using -std=c++11,
which I'll fix shortly.

Committed to trunk.

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]