Debian Codegraph @

libstdc++-v3/testsuite/23_containers/list/capacity/node_sizes.cc

raw
1 // { dg-do compile { target c++11 } }
2
3 #include <list>
4
5 #if _GLIBCXX_LIST_USE_ALLOC_PTR
6
7 #ifdef _GLIBCXX_DEBUG
8 namespace C = std::_GLIBCXX_STD_C;
9 #else
10 namespace C = std;
11 #endif
12
13 // We use double here because for ADJUST_FIELD_ALIGN targets (like i386)
14 // its alignment differs when used as a data member or as a complete object.
15 static_assert(sizeof(C::_List_node<double>)
16 == sizeof(std::__list::_Node<double*>),
17 "node types have same size");
18 static_assert(alignof(C::_List_node<double>)
19 == alignof(std::__list::_Node<double*>),
20 "node types have same alignment");
21 static_assert(__alignof(C::_List_node<double>)
22 == __alignof(std::__list::_Node<double*>),
23 "node types have same preferred alignment");
24 #endif