2 // { dg-additional-options "-Wno-return-type" }
4 template <typename> struct remove_reference;
5 template <typename _Tp> struct remove_reference<_Tp &> { typedef _Tp type; };
6 template <typename _Tp> typename remove_reference<_Tp>::type move(_Tp &&p1) {
7 return static_cast<typename remove_reference<_Tp>::type &&>(p1);
9 void *operator new(__SIZE_TYPE__, void *p2) { return p2; }
10 struct Trans_NS__v1_GenericTlv {
11 virtual int getMinimumValueLength();
12 virtual unsigned long getValueLength() const;
14 struct IPv4NeighborAddressSubTlv;
15 struct Trans_NS__v1_GenericTlvBase : Trans_NS__v1_GenericTlv {
16 virtual bool operator==(const IPv4NeighborAddressSubTlv &) const;
18 struct Trans_NS__v1_GenericUnsupportedTlv;
19 template <typename> struct backup_holder {
20 Trans_NS__v1_GenericUnsupportedTlv *backup_;
21 Trans_NS__v1_GenericUnsupportedTlv &get() { return *backup_; }
23 template <typename> struct make_reference_content {
24 typedef IPv4NeighborAddressSubTlv type;
26 template <typename> struct unwrap_recursive {
27 typedef IPv4NeighborAddressSubTlv type;
29 template <typename> struct begin_impl;
30 template <typename Sequence> struct begin {
31 typedef typename Sequence::tag tag_;
32 typedef typename begin_impl<tag_>::template apply<Sequence>::type type;
35 static const int value = 0;
37 template <typename> struct O1_size_impl;
38 template <typename Sequence>
40 : O1_size_impl<typename Sequence::tag>::template apply<Sequence> {};
41 template <typename F, typename T2>
42 struct apply_wrap2 : F::template apply<int, T2> {};
43 template <int, typename, typename> struct iter_fold_impl;
44 template <typename First, typename ForwardOp>
45 struct iter_fold_impl<0, First, ForwardOp> {
46 typedef typename apply_wrap2<ForwardOp, First>::type state;
48 template <typename Sequence, typename ForwardOp> struct iter_fold {
50 typename iter_fold_impl<O1_size<Sequence>::value,
51 typename begin<Sequence>::type, ForwardOp>::state
54 template <typename> struct deref;
55 template <typename T1> struct pair { typedef T1 first; };
56 struct make_initializer_node {
57 template <typename, typename Iterator> struct apply {
58 struct initializer_node {
59 typedef typename deref<Iterator>::type recursive_enabled_T;
62 typename unwrap_recursive<recursive_enabled_T>::type) {
63 new (p1) typename make_reference_content<recursive_enabled_T>::type;
66 typedef pair<initializer_node> type;
75 template <> struct O1_size_impl<int> {
76 template <typename List> struct apply : List::size {};
78 template <typename> struct l_iter;
79 template <typename Node> struct deref<l_iter<Node>> {
80 typedef typename Node::item type;
82 template <> struct begin_impl<int> {
83 template <typename List> struct apply {
84 typedef l_iter<typename List::type> type;
87 template <typename, typename, typename, typename, typename, typename, typename>
88 struct list : l_item {};
89 template <typename... T> struct make_variant_list { typedef list<T...> type; };
90 template <typename T> T cast_storage(void *p1) { return *static_cast<T *>(p1); }
91 struct visitation_impl_step {
92 typedef Trans_NS__v1_GenericUnsupportedTlv type;
94 template <typename Visitor, typename VoidPtrCV, typename T>
95 void visitation_impl_invoke_impl(Visitor p1, VoidPtrCV p2, T *) {
96 backup_holder<Trans_NS__v1_GenericUnsupportedTlv> __trans_tmp_8 =
97 cast_storage<backup_holder<T>>(p2);
98 p1.internal_visit(__trans_tmp_8, 0);
100 template <typename Visitor, typename VoidPtrCV, typename T,
101 typename NoBackupFlag>
102 void visitation_impl_invoke(Visitor p1, VoidPtrCV p2, T p3, NoBackupFlag) {
103 visitation_impl_invoke_impl(p1, p2, p3);
105 template <typename Which, typename step0, typename Visitor, typename VoidPtrCV,
106 typename NoBackupFlag>
107 void visitation_impl(Visitor p1, VoidPtrCV p2, NoBackupFlag, Which, step0 *) {
108 visitation_impl_invoke(p1, p2, static_cast<typename step0::type *>(0), 0);
112 template <typename T> void internal_visit(backup_holder<T> p1, int) {
113 T __trans_tmp_2 = p1.get();
114 new (0) T(__trans_tmp_2);
117 template <typename, typename... TN> struct variant {
118 struct initializer : iter_fold<typename make_variant_list<int, TN...>::type,
119 make_initializer_node>::type::first {};
120 template <typename T> void convert_construct(T p1, int) {
121 void *__trans_tmp_9 = this;
122 initializer::initialize(__trans_tmp_9, p1);
124 template <typename T> variant(T p1) { convert_construct(p1, 0); }
125 variant(variant &&p1) {
126 move_into visitor(0);
127 p1.internal_apply_visitor(visitor);
129 template <typename Visitor> void internal_apply_visitor(Visitor p1) {
130 void *__trans_tmp_10 = this;
131 visitation_impl(p1, __trans_tmp_10, 0, 0,
132 static_cast<visitation_impl_step *>(0));
135 template <class...> struct generic_element_tlvs;
136 template <typename TlvConfig, class UnsupportedTlvClass, class TlvF,
138 struct generic_element_tlvs<TlvConfig, UnsupportedTlvClass, TlvF, TlvR...> {
139 typedef variant<UnsupportedTlvClass, TlvF, TlvR...> variant_type;
141 template <typename, typename> struct Trans_NS__v1_GenericTlvContainer {
142 template <class TlvClass> void addTlv(const TlvClass &);
144 template <typename TlvConfig, typename ElementTlvs>
145 template <class TlvClass>
146 void Trans_NS__v1_GenericTlvContainer<TlvConfig, ElementTlvs>::addTlv(
147 const TlvClass &p1) {
148 typename ElementTlvs::variant_type wrap(p1);
151 template <typename ElementTlvs>
152 struct Trans_NS__v1_GenericContainerEntryBase
153 : Trans_NS__v1_GenericTlvContainer<int, ElementTlvs> {};
155 struct Trans_NS__v1_GenericFixedLengthTlvBase : Trans_NS__v1_GenericTlvBase {
156 unsigned long getValueLength() const;
158 struct Trans_NS__v1_GenericUnsupportedTlv : Trans_NS__v1_GenericTlv {
159 long getHeaderLengthconst;
161 using isis_tlv_config = int;
162 template <class... TlvClasses>
163 using isis_element_tlvs =
164 generic_element_tlvs<isis_tlv_config, Trans_NS__v1_GenericUnsupportedTlv,
166 template <int, class, typename ElementTlvs>
167 using ContainerEntryBase = Trans_NS__v1_GenericContainerEntryBase<ElementTlvs>;
168 template <int, class ImplClass, int>
169 using FixedLengthTlvBase = Trans_NS__v1_GenericFixedLengthTlvBase<ImplClass>;
170 struct IPv4NeighborAddressSubTlv
171 : FixedLengthTlvBase<0, IPv4NeighborAddressSubTlv, 0> {
172 bool operator==(const IPv4NeighborAddressSubTlv &) const;
178 FixedLengthTlvBase<0, int, 0>, FixedLengthTlvBase<0, int, 0>,
179 IPv4NeighborAddressSubTlv, FixedLengthTlvBase<0, int, 0>,
180 FixedLengthTlvBase<0, int, 0>, FixedLengthTlvBase<0, int, 0>>>
182 IPv4NeighborAddressSubTlv nbAddressSubTlv;
183 isEntry.addTlv(nbAddressSubTlv);