mirror of
git://gcc.gnu.org/git/gcc.git
synced 2025-04-21 14:41:07 +08:00
libstdc++: Reduce the size of an unbounded iota_view
libstdc++-v3/ChangeLog: * include/std/ranges (iota_view::_M_bound): Give it [[no_unique_address]]. * testsuite/std/ranges/iota/iota_view.cc: Check that an unbounded iota_view has minimal size.
This commit is contained in:
parent
e189d5c931
commit
623443357e
@ -511,7 +511,7 @@ namespace ranges
|
||||
};
|
||||
|
||||
_Winc _M_value = _Winc();
|
||||
_Bound _M_bound = _Bound();
|
||||
[[no_unique_address]] _Bound _M_bound = _Bound();
|
||||
|
||||
public:
|
||||
iota_view() = default;
|
||||
|
@ -77,6 +77,9 @@ test04()
|
||||
VERIFY( it == v.end() );
|
||||
}
|
||||
|
||||
// Verify we optimize away the 'bound' data member of an unbounded iota_view.
|
||||
static_assert(sizeof(std::ranges::iota_view<char>) == 1);
|
||||
|
||||
int
|
||||
main()
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user