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] Implement P0426R1 "Constexpr for std::char_traits" for C++17 (partial)


We can't fully implement this without compiler support (see PR80265)
but this adds _GLIBCXX17_CONSTEXPR where possible.

I've left /* _GLIBCXX17_CONSTEXPR */ comments where we need to add it
once the compiler allows it.

	* include/bits/char_traits.h (__gnu_cxx::char_traits): Add
	_GLIBCXX14_CONSTEXPR on assign, compare, find, and length.
	(std::char_traits<char>, std::char_traits<wchar_t>): Add
	_GLIBCXX17_CONSTEXPR on assign.
	(std::char_traits<char16_t>, std::char_traits<char32_t>): Add
	_GLIBCXX17_CONSTEXPR on assign, compare, find, and length.
	* testsuite/21_strings/char_traits/requirements/
	constexpr_functions_c++17.cc: New test.

Tested powerpc64le-linux, 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]