gcc/libstdc++-v3
Patrick Palka 0e64bbb882 libstdc++: Allow adjacent __maybe_present_t<false, ...> fields to overlap
Currently __maybe_present_t<false, T> maps to the same empty class
type independent of T.  This is suboptimal because it means adjacent
__maybe_present_t<false, ...> members with the [[no_unique_address]]
attribute can't overlap even if the conditionally present types are
different.

This patch turns this empty class type into a template parameterized by
the conditionally present type, so that

  [[no_unique_address]] __maybe_present_t<false, T> _M_a;
  [[no_unique_address]] __maybe_present_t<false, U> _M_b;

now overlap if T and U are different.

This patch goes a step further and also adds an optional integer
discriminator parameter to allow for overlapping when T and U are
the same.

libstdc++-v3/ChangeLog:

	* include/std/ranges (ranges::__detail::_Empty): Rename to ...
	(ranges::__detail::_Absent): ... this.  Turn into a template
	parameterized by the absent type _Tp and discriminator _Disc.
	(ranges::__detail::__maybe_present_t): Add an optional
	discriminator parameter.
	(slide_view::_M_cached_begin): Pass a discriminator argument to
	__maybe_present_t.
	(slide_view::_M_cached_end): Likewise.
	* testsuite/std/ranges/adaptors/sizeof.cc: Verify the size of
	slide_view<V> is 3 instead 4 pointers.

Reviewed-by: Jonathan Wakely <jwakely@redhat.com>
2024-04-02 13:07:07 -04:00
..
config Update copyright years. 2024-01-03 12:19:35 +01:00
doc libstdc++: Update docs on build process and generated files 2024-03-19 15:20:07 +00:00
include libstdc++: Allow adjacent __maybe_present_t<false, ...> fields to overlap 2024-04-02 13:07:07 -04:00
libsupc++ libstdc++, Darwin: Handle a linker warning [PR112397]. 2024-02-19 20:14:34 +00:00
po Update copyright years. 2024-01-03 12:19:35 +01:00
python libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318] 2024-01-17 11:49:11 +00:00
scripts libstdc++: Fix Python scripts to output the correct filename 2024-03-19 15:20:07 +00:00
src libstdc++: Do not define lock-free atomic aliases if not fully lock-free [PR114103] 2024-03-07 20:55:25 +00:00
testsuite libstdc++: Allow adjacent __maybe_present_t<false, ...> fields to overlap 2024-04-02 13:07:07 -04:00
acinclude.m4 Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
aclocal.m4
ChangeLog Daily bump. 2024-03-30 00:16:42 +00:00
ChangeLog-1998
ChangeLog-1999
ChangeLog-2000
ChangeLog-2001
ChangeLog-2002
ChangeLog-2003
ChangeLog-2004
ChangeLog-2005
ChangeLog-2006
ChangeLog-2007
ChangeLog-2008
ChangeLog-2009
ChangeLog-2010
ChangeLog-2011
ChangeLog-2012
ChangeLog-2013
ChangeLog-2014
ChangeLog-2015
ChangeLog-2016
ChangeLog-2017
ChangeLog-2018
ChangeLog-2019
ChangeLog-2020
ChangeLog-2021
ChangeLog-2022 Rotate ChangeLog files. 2023-01-01 16:20:13 +01:00
ChangeLog-2023 Rotate ChangeLog files. 2024-01-03 11:29:39 +01:00
config.h.in libstdc++: Implement C++26 std::text_encoding (P1885R12) [PR113318] 2024-01-17 11:49:11 +00:00
configure libstdc++, Darwin: Handle a linker warning [PR112397]. 2024-02-19 20:14:34 +00:00
configure.ac libstdc++, Darwin: Handle a linker warning [PR112397]. 2024-02-19 20:14:34 +00:00
configure.host Fix up duplicated words mostly in comments, part 1 2024-04-02 13:39:11 +02:00
crossconfig.m4
fragment.am
linkage.m4 libstdc++: Remove handling for underscore-prefixed libm functions [PR111638] 2023-11-11 00:41:08 +00:00
Makefile.am Update copyright years. 2024-01-03 12:19:35 +01:00
Makefile.in Allow overriding EXPECT 2023-12-22 10:24:56 +00:00
README

file: libstdc++-v3/README

New users may wish to point their web browsers to the file
index.html in the 'doc/html' subdirectory.  It contains brief
building instructions and notes on how to configure the library in
interesting ways.