[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[creduce-bugs] template-non-type-arg-to-int failed to modify testcase
With current Creduce trunk I get:
...
===< pass_clang :: template-non-type-arg-to-int >===
(15.4 %, 36484 bytes)
=======================================
OOPS: pass_clang::template-non-type-arg-to-int failed to
modify the test case, which means you have
encountered a bug in C-Reduce. Please consider
mailing /var/tmp/creduce_bug_378116 to
creduce-bugs@flux.utah.edu and we will try to fix
the bug. Please also let us know what version of
C-Reduce you are using and include any other
details that may help us reproduce the problem.
=======================================
Died at /home/markus/creduce/creduce/creduce line 530.
(Creduce should keep running here.)
markus@x4 clang_delta % ./test_transformation -keep -transformation=template-non-type-arg-to-int /tmp/creduce_bug.ii
...
Transformation results:
transformation[template-non-type-arg-to-int]: All instances suceeded!
markus@x4 clang_delta % cd working_dir/template-non-type-arg-to-int_1/ && md5sum * | sort -u
02fe073048b41674b746a6eab951ea59 template-non-type-arg-to-int_47.ii
178f5de179836defa805e2439235eff9 template-non-type-arg-to-int_46.ii
1bbaa5d3ef65f0e7a1cdd75ce4dca4f7 template-non-type-arg-to-int_19.ii
21162d3bcf6ad298d093a249278e7fc6 template-non-type-arg-to-int_8.ii
219407d25f53642297674c299fdc02bc template-non-type-arg-to-int_1.ii
24cf5f13fc10b252f6de08ec3b435663 template-non-type-arg-to-int_43.ii
41a2dd09d9d65bfb47a685ac3eea5929 template-non-type-arg-to-int_5.ii
4c55f0d65cd288d58dea9c2db289ea56 template-non-type-arg-to-int_39.ii
5030fe046195e4b2384babc4a4c5dae5 template-non-type-arg-to-int_9.ii
51163c456ca07ceb4b2485fb8a852ad1 template-non-type-arg-to-int_41.ii
53dc431dd658bd47bea1ee5fb0f6e52d template-non-type-arg-to-int_33.ii
58421bbf037776037dfde824daab4d62 template-non-type-arg-to-int_42.ii
5e9700586ecd759f2197d3a91c8d2d28 template-non-type-arg-to-int_15.ii
66c5c76d5bf640f944712cb4c5a07ca6 template-non-type-arg-to-int_38.ii
6b41fe9ddc70251f448fef4ccbef8b2f template-non-type-arg-to-int_0.ii
6b41fe9ddc70251f448fef4ccbef8b2f template-non-type-arg-to-int_23.ii
6b41fe9ddc70251f448fef4ccbef8b2f template-non-type-arg-to-int_24.ii
6b41fe9ddc70251f448fef4ccbef8b2f template-non-type-arg-to-int_3.ii
6b41fe9ddc70251f448fef4ccbef8b2f template-non-type-arg-to-int_40.ii
6d91989a2d9ca0ee24d3fc4b2df391ec template-non-type-arg-to-int_4.ii
7d3b808ae517f49703a988c4793c6c74 template-non-type-arg-to-int_10.ii
80b1a59de167e854daed3a92c6a02666 template-non-type-arg-to-int_35.ii
855d2d40813d437082e843c2566bff53 template-non-type-arg-to-int_32.ii
8ca66a1edbe4c3ecac5bb72ad4935857 template-non-type-arg-to-int_27.ii
8d9972704f0c2c19c8d30776f1b93f2d template-non-type-arg-to-int_2.ii
9e7f57009ca0ceb1fb407121885c91d9 template-non-type-arg-to-int_37.ii
a162c88b1282a91c0a8adb9eca46c6d7 template-non-type-arg-to-int_36.ii
af9a15ececda35e1c5e24e8e75a9f819 template-non-type-arg-to-int_16.ii
b474859967ef3a8e4590f061578d508e template-non-type-arg-to-int_31.ii
b5894928e73af93797a70a8bbeb7ed27 template-non-type-arg-to-int_34.ii
b6549e421d073cd5fd50f65f03ab5cf6 template-non-type-arg-to-int_13.ii
bb7d2c4f14a13eb9f6dbf5649c41f8ae template-non-type-arg-to-int_29.ii
c1e4f9648314bfcba340ae9ce27f51ce template-non-type-arg-to-int_30.ii
c2e1814cb11e48055adbc5a4680daf84 template-non-type-arg-to-int_45.ii
c4b333c02f01e5654b565455cf635ce5 template-non-type-arg-to-int_18.ii
c953e6ddaf40ffcb1fc84e7656d8f1bc template-non-type-arg-to-int_28.ii
cbdd6a21d9d0d248154cc28cb01422dd template-non-type-arg-to-int_22.ii
d5fa166d3a99576a03431a324628b909 template-non-type-arg-to-int_20.ii
d7cc7dea0b8ded23d95915d05b94af84 template-non-type-arg-to-int_12.ii
e249fe63f8f8988ae77cd4313d9b4c54 template-non-type-arg-to-int_6.ii
e34b021cfc1ae59c2094b3dd360e5502 template-non-type-arg-to-int_26.ii
e618c6d9e64c211a46588e2562c2c805 template-non-type-arg-to-int_21.ii
ef1e97cca36a80add883100aa9554544 template-non-type-arg-to-int_25.ii
efc5d956d8dab73b2a207185483fae6c template-non-type-arg-to-int_7.ii
eff54e291b1dae3054920c938c3410cf template-non-type-arg-to-int_11.ii
f085a1893c6f11259a03ef38610a1a40 template-non-type-arg-to-int_44.ii
f0bdf22f9cde1192194abe4af1deccab template-non-type-arg-to-int_17.ii
fb0dc7e5d2aa6f6a0668eaf5ee8ff3b2 template-non-type-arg-to-int_48.ii
fbca1a3d7e5f5e75e12ed69be04dccd8 template-non-type-arg-to-int_14.ii
The testcase is attached.
--
Markus
namespace std {
typedef long unsigned int size_t;
}
typedef struct
__mbstate_t;
namespace mpl_ {
}
namespace mpl {
using namespace mpl_;
}
namespace mpl_ {
struct integral_c_tag ;
template< int N > struct int_ {
static const int value = N;
};
}
namespace mpl {
template< typename F > struct template_arity;
}
namespace mpl_ {
template< bool C_ > struct bool_;
typedef bool_<true> true_;
typedef bool_<false> false_;
template< bool C_ > struct bool_ {
static const bool value = C_;
typedef bool_ type;
};
template< typename T, int N > struct integral_c {
static const int value = N;
typedef integral_c type;
};
}
template <class T, int val> struct integral_constant : public mpl::integral_c<int, 1> {
};
namespace mpl_ {
struct void_;
struct na ;
}
namespace mpl {
template< typename T > struct is_na : false_ {
};
template<> struct is_na<na> : true_ {
};
template< typename T = na , typename Tag = void_ , typename Arity = int_< template_arity<T>::value > > struct lambda;
}
namespace mpl {
template< bool C , typename T1 , typename T2 > struct if_c {
typedef T1 type;
};
template< typename T1 , typename T2 > struct if_c<false,T1,T2> {
typedef T2 type;
};
template< typename T1 = na , typename T2 = na , typename T3 = na > struct if_ {
private:
public: typedef typename if_c<static_cast<bool>(T1::value), T2, T3>::type type;
};
}
namespace mpl {
template< typename T > struct nested_type_wknd : T::type {
};
}
namespace mpl {
template< bool C_, typename T1, typename T2, typename T3, typename T4 > struct or_impl : true_ {
};
template< typename T1 = na , typename T2 = na , typename T3 = false_, typename T4 = false_, typename T5 = false_ > struct or_ : or_impl< 1 , int, int, int, int > {
};
}
struct blank;
namespace mpl_ {
template< int N > struct arg;
}
namespace mpl {
template< long C_ > struct not_impl : bool_<!C_> {
};
template< typename T = na > struct not_ : not_impl< ::mpl::nested_type_wknd<T>::value > {
};
typedef char (&no_tag)[1];
typedef char (&yes_tag)[2];
template< bool C_ > struct yes_no_tag ;
}
namespace mpl_ {
struct assert_ ;
template<> struct arg<1> {
typedef arg next;
template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply {
typedef U1 type;
};
};
template<> struct arg<2> {
template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply {
typedef U2 type;
};
};
}
namespace mpl {
template< typename T > struct type_wrapper {
};
template< int N > struct arity_tag {
typedef char (&type)[N + 1];
};
template< int C1, int C2, int C3, int C4, int C5, int C6 > struct max_arity {
static const int value = C6 > 0 ? C6 : C5 > 0 ? C5 : C4 > 0 ? C4 : C3 > 0 ? C3 : C2 > 0 ? C2 : C1 > 0 ? C1 : -1 ;
};
void arity_helper(...);
template< template< typename P1 > class F , typename T1 > typename arity_tag<1>::type arity_helper(type_wrapper< F<T1> >, arity_tag<1>);
template< template< typename P1, typename P2 > class F , typename T1, typename T2 > typename arity_tag<2>::type arity_helper(type_wrapper< F< T1,T2 > >, arity_tag<2>);
template< typename F, int N > struct template_arity_impl {
static const int value = sizeof::mpl::arity_helper(type_wrapper<F>(), arity_tag<N>()) - 1 ;
};
template< typename F > struct template_arity {
static const int value = max_arity< template_arity_impl< F,1 >::value, template_arity_impl< F,2 >::value, template_arity_impl< F,3 >::value, template_arity_impl< F,4 >::value, template_arity_impl< F,5 >::value, template_arity_impl< F,6 >::value >::value ;
};
}
namespace detail {
namespace variant {
template <typename T> class backup_holder ;
}
}
namespace detail {
namespace variant {
template <typename T> struct is_recursive_flag : mpl::false_ {
};
template < typename RecursiveVariant , typename NoWrapper = mpl::false_ > struct quoted_enable_recursive;
}
}
template< typename T, typename U > struct is_same : public ::integral_constant<bool,false> {
public: };
namespace detail{
template <class T> struct has_nothrow_copy_imp;
}
template< typename T > struct has_nothrow_copy : public ::integral_constant<bool,::detail::has_nothrow_copy_imp<T>::value> {
public: };
namespace detail {
template <typename T = mpl::void_> struct make_reference_content;
template <typename T> struct make_reference_content {
typedef int type;
};
template <> struct make_reference_content< mpl::void_ > {
template <typename T> struct apply : make_reference_content<int> {
};
};
}
namespace mpl {
template< typename C = na , typename F1 = na , typename F2 = na > struct eval_if {
typedef typename if_<C,F1,F2>::type f_;
typedef typename f_::type type;
};
template< typename T, typename fallback_ = mpl::bool_<true> > struct has_begin {
struct gcc_3_2_wknd {
template< typename U > static mpl::yes_tag test( mpl::type_wrapper<U> const volatile* , mpl::type_wrapper<typename U::begin>* = 0 );
static mpl::no_tag test(...);
};
static const bool value = sizeof(gcc_3_2_wknd::test(static_cast<mpl::type_wrapper<int>*>(0))) == sizeof(mpl::yes_tag);
};
}
namespace mpl {
template< typename Sequence > struct begin_type {
typedef int type;
};
template< typename Sequence > struct end_type {
typedef int type;
};
template< typename Tag > struct begin_impl {
template< typename Sequence > struct apply {
typedef int type;
};
};
template< typename Tag > struct end_impl {
template< typename Sequence > struct apply {
typedef int type;
};
};
}
namespace mpl {
template< typename T, typename fallback_ = mpl::bool_<false> > struct has_tag {
struct gcc_3_2_wknd ;
typedef int t_;
static const bool value = sizeof(0) == sizeof(mpl::yes_tag);
};
template< bool has_tag_, bool has_begin_ > struct sequence_tag_impl {
template< typename Sequence > struct result2_ {
typedef typename Sequence::tag type;
};
};
template struct sequence_tag_impl<true,false> ;
template< typename Sequence = na > struct sequence_tag : sequence_tag_impl< ::mpl::has_tag<Sequence>::value , ::mpl::has_begin<Sequence>::value >::template result2_<Sequence> {
};
template< typename Sequence = na > struct begin {
typedef typename sequence_tag<Sequence>::type tag_;
typedef typename begin_impl< tag_ > ::template apply< Sequence >::type type;
};
template< typename Sequence = na > struct end {
typedef int tag_;
typedef int type;
};
template< typename Tag > struct O1_size_impl;
}
namespace mpl_ {
template< long N > struct long_ {
static const long value = N;
typedef mpl_::long_< static_cast<long>(N + 1) > next;
};
}
namespace mpl {
template< typename Sequence = na > struct O1_size : O1_size_impl< typename sequence_tag<Sequence>::type > ::template apply< Sequence > {
};
}
namespace mpl_ {
typedef arg<1> _1;
}
namespace mpl {
template< typename T = na > struct next {
typedef typename T::next type;
};
}
namespace mpl {
template< typename T = na , int not_le_ = 0 > struct protect : T {
};
}
namespace mpl {
template< typename F, typename T1 > struct apply_wrap1 : F::template apply<T1> {
};
template< typename F, typename T1, typename T2 > struct apply_wrap2 : F::template apply< T1,T2 > {
};
template< typename F, typename T1, typename T2, typename T3, typename T4 , typename T5 > struct apply_wrap5 : F::template apply< T1,T2,int,int,int > {
};
template< typename T, typename U1, typename U2, typename U3, typename U4 , typename U5 > struct resolve_bind_arg {
typedef int type;
};
template< typename T , typename Arg > struct replace_unnamed_arg {
typedef int next;
typedef T type;
};
template< typename Arg > struct replace_unnamed_arg< arg< -1 >, Arg > {
typedef typename Arg::next next;
typedef Arg type;
};
template< int N, typename U1, typename U2, typename U3, typename U4, typename U5 > struct resolve_bind_arg< arg<N>, U1, U2, U3, U4, U5 > {
typedef typename apply_wrap5<mpl::arg<N>, U1, U2, U3, U4, U5>::type type;
};
template< typename F, typename T1 > struct bind1 {
template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply {
private: typedef replace_unnamed_arg< F, int > r0;
typedef F a0;
typedef a0 f_;
typedef replace_unnamed_arg< T1,int > r1;
public: typedef typename apply_wrap1< f_ , typename resolve_bind_arg<T1, U1, U2, int, int, int>::type >::type type;
};
};
template< typename F, typename T1, typename U1, typename U2, typename U3 , typename U4, typename U5 > struct resolve_bind_arg< bind1< F,T1 >, U1, U2, U3, U4, U5 > {
typedef typename apply_wrap5< bind1<F, T1>,U1,U2,U3,U4,U5 >::type type;
};
template< typename F, typename T1, typename T2 > struct bind2 {
template< typename U1 = na, typename U2 = na, typename U3 = na , typename U4 = na, typename U5 = na > struct apply {
private: typedef replace_unnamed_arg< F, int > r0;
typedef mpl::arg<1> n1;
typedef replace_unnamed_arg< int,int > r1;
typedef int a1;
typedef resolve_bind_arg< typename replace_unnamed_arg<T2, n1>::type,U1,U2,int,int,int > t2;
public: typedef typename apply_wrap2< F , typename U1::type, typename t2::type >::type type;
};
};
template< typename T, typename fallback_ = mpl::bool_<true> > struct has_type {
struct gcc_3_2_wknd ;
typedef int t_;
static const bool value = sizeof(0) == sizeof(mpl::yes_tag);
};
template< typename T, bool has_type_ > struct quote_impl {
typedef T type;
};
template< template< typename P1 > class F , typename Tag = void_ > struct quote1 {
template< typename U1 > struct apply : quote_impl< F<U1> , has_type< F<U1> >::value > {
};
};
template< template< typename P1, typename P2 > class F , typename Tag = void_ > struct quote2 {
template< typename U1, typename U2 > struct apply : quote_impl< F< int,int > , has_type< F< int,int > >::value > {
};
};
}
namespace mpl {
template< bool C1 = false, bool C2 = false, bool C3 = false, bool C4 = false , bool C5 = false > struct lambda_or : true_ {
};
template<> struct lambda_or< false,false,false,false,false > : false_ {
};
template< typename T , typename Tag , typename Arity > struct lambda {
typedef false_ is_le;
typedef T type;
};
template< typename T > struct is_lambda_expression : lambda<int>::is_le {
};
template< int N, typename Tag > struct lambda< arg<N>,Tag, int_< -1 > > {
typedef true_ is_le;
typedef mpl::arg<N> result_;
typedef mpl::protect<result_> type;
};
template< typename IsLE, typename Tag , template< typename P1 > class F , typename L1 > struct le_result1 {
typedef F< typename L1::type > result_;
typedef result_ type;
};
template< typename Tag , template< typename P1 > class F , typename L1 > struct le_result1< true_,Tag,F,L1 > {
typedef mpl::protect<bind1<quote1<F, Tag>, typename L1::result_>> type;
};
template< template< typename P1 > class F , typename T1 , typename Tag > struct lambda< F<T1> , Tag , int_<1> > {
typedef lambda< T1,Tag > l1;
typedef typename l1::is_le is_le1;
typedef typename le_result1<typename lambda_or<is_le1::value>::type, Tag, F, l1>::type type;
};
template< typename IsLE, typename Tag , template< typename P1, typename P2 > class F , typename L1, typename L2 > struct le_result2 {
typedef F<typename L1::type, typename L2::type> type;
};
template< typename Tag , template< typename P1, typename P2 > class F , typename L1, typename L2 > struct le_result2< true_,Tag,F,L1,L2 > {
typedef mpl::protect<bind2<quote2<F, Tag>, typename L1::result_, typename L2::result_>> type;
};
template< template< typename P1, typename P2 > class F , typename T1, typename T2 , typename Tag > struct lambda< F< T1,T2 > , Tag , int_<2> > {
typedef lambda< T1,Tag > l1;
typedef lambda< T2,Tag > l2;
typedef typename l1::is_le is_le1;
typedef typename l2::is_le is_le2;
typedef typename le_result2<typename lambda_or<is_le1::value, is_le2::value>::type, Tag, F, l1, l2>::type type;
};
}
namespace mpl {
template< typename F, typename T1 > struct apply1 : apply_wrap1< typename lambda<int>::type , T1 > {
};
template< typename F, typename T1, typename T2 > struct apply2 : apply_wrap2< typename lambda<F>::type , T1, T2 > {
};
template< int N , typename First , typename Last , typename State , typename ForwardOp > struct iter_fold_impl;
template< typename First , typename Last , typename State , typename ForwardOp > struct iter_fold_impl< 1,First,Last,State,ForwardOp > {
typedef State state0;
typedef typename apply2<ForwardOp, state0, First>::type state;
};
}
namespace mpl {
template< typename Sequence = na , typename State = na , typename ForwardOp = na > struct iter_fold {
typedef typename iter_fold_impl< ::mpl::O1_size<Sequence>::value , typename begin<Sequence>::type , typename end<Sequence>::type , State , typename lambda<ForwardOp>::type >::state type;
};
template< typename Iterator = na > struct deref ;
template< typename T1 = na , typename T2 = na > struct pair {
typedef int first;
typedef int second;
};
template< typename P = na > struct first ;
template< typename P = na > struct second ;
}
namespace mpl {
template< typename Tag > struct push_front_impl;
}
namespace mpl {
struct list_tag;
template< typename Size , typename T , typename Next > struct l_item {
typedef list_tag tag;
typedef l_item type;
typedef mpl_::long_<1> size;
typedef T item;
};
struct l_end {
typedef list_tag tag;
typedef l_end type;
typedef long_<0> size;
};
template<> struct push_front_impl< list_tag > {
template< typename List, typename T > struct apply {
typedef l_item< typename next<typename List::size>::type , T , typename List::type > type;
};
};
template< typename Sequence, typename T > struct push_back;
template< typename Tag > struct clear_impl;
template<> struct clear_impl< list_tag > {
template< typename List > struct apply {
typedef l_end type;
};
};
template<> struct O1_size_impl< list_tag > {
struct symbol;
template< typename List > struct apply : mpl::l_item<int, int, int>::size {
};
};
}
namespace mpl {
template< typename Node > struct l_iter ;
template< typename Node > struct deref< l_iter<Node> > {
typedef typename Node::item type;
};
template<> struct begin_impl< list_tag > {
template< typename List > struct apply {
typedef l_iter<typename List::type> type;
};
};
template<> struct end_impl< int > {
template< typename > struct apply {
};
};
}
namespace mpl {
template< typename T0 > struct list1 : l_item< int , T0 , int > {
};
template< typename T0 = na, typename T1 = na, typename T2 = na, typename T3 = na , typename T4 = na, typename T5 = na, typename T6 = na, typename T7 = na , typename T8 = na, typename T9 = na, typename T10 = na, typename T11 = na , typename T12 = na, typename T13 = na, typename T14 = na , typename T15 = na, typename T16 = na, typename T17 = na , typename T18 = na, typename T19 = na > struct list;
template< typename T0 > struct list< T0, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na, na , na, na, na > : list1<T0> {
};
}
namespace detail {
namespace variant {
template < typename... T > struct make_variant_list {
typedef typename mpl::list< T... >::type type;
};
}
namespace variant {
template <typename Types> struct over_sequence ;
template <typename T> struct is_over_sequence : mpl::false_ {
};
}
namespace variant {
template <typename T> void cast_storage(void* storage) ;
template <typename T> inline const T& cast_storage(const void* storage) {
return *static_cast<const T*>(storage);
}
}
}
namespace mpl {
template< typename T = na > struct identity {
typedef T type;
};
}
namespace detail{
template <class T> struct is_nothrow_move_constructible_imp;
}
template< typename T > struct is_nothrow_move_constructible : public ::integral_constant<bool,::detail::is_nothrow_move_constructible_imp<T>::value> {
public: };
namespace detail {
namespace variant {
struct apply_visitor_unrolled ;
template <typename Iter, typename LastIter> struct visitation_impl_step {
typedef typename mpl::deref<Iter>::type type;
};
template <typename Visitor, typename VoidPtrCV, typename T> void visitation_impl_invoke_impl( int, Visitor& visitor, VoidPtrCV storage, T* _ ) {
visitor.internal_visit( cast_storage<T>(storage), 1L );
}
int visitation_impl_invoke_internal_which;
template <typename Visitor, typename VoidPtrCV, typename T, typename NoBackupFlag> void visitation_impl_invoke( Visitor& visitor, VoidPtrCV storage, T* t , NoBackupFlag , int ) {
typedef typename mpl::or_< NoBackupFlag , is_nothrow_move_constructible<T> , has_nothrow_copy<T> >::type never_uses_backup;
visitation_impl_invoke_impl( visitation_impl_invoke_internal_which, visitor, storage, t );
}
template < typename Which, typename step0 , typename Visitor, typename VoidPtrCV , typename NoBackupFlag > void visitation_impl( const int internal_which, const int logical_which , Visitor& visitor, VoidPtrCV storage , mpl::false_ , NoBackupFlag no_backup_flag , Which* = 0, step0* = 0 ) {
switch (logical_which)
case Which::value + 0: visitation_impl_invoke( visitor, storage , static_cast<typename step0::type*>(0) , no_backup_flag, 1L );
}
}
struct is_static_visitor_tag {
};
typedef void static_visitor_default_return;
}
template <typename R = ::detail::static_visitor_default_return> class static_visitor : public detail::is_static_visitor_tag {
public: typedef void result_type;
};
namespace mpl_ {
template< std::size_t N > struct size_t {
static const std::size_t value = N;
typedef size_t type;
};
}
namespace detail {
template< typename T > struct alignment_of_impl {
static const std::size_t value = __alignof__(int);
};
}
template< typename T > struct alignment_of : public ::integral_constant<std::size_t,::detail::alignment_of_impl<int>::value> {
public: };
namespace detail {
template < std::size_t size_ , std::size_t alignment_ > struct aligned_storage_imp {
struct data_t {
char buf[size_];
}
data_;
void* address() const {
return const_cast<aligned_storage_imp*>(this);
}
};
}
template < std::size_t size_ , std::size_t alignment_ = std::size_t(-1) > class aligned_storage : private ::detail::aligned_storage_imp<size_, alignment_> {
public:
const void* address() const {
return static_cast<const ::detail::aligned_storage_imp<size_, alignment_>*>(this)->address();
}
};
template < unsigned long Value1, unsigned long Value2 > struct static_gcd_helper_t {
private: static const unsigned long new_value1 = Value2;
static const unsigned long new_value2 = Value1 % Value2;
public: static const unsigned long value = static_gcd_helper_t<static_cast<unsigned long>(Value2), static_cast<unsigned long>(new_value2)>::value;
};
template < unsigned long Value1 > struct static_gcd_helper_t< Value1, 0UL > {
static const unsigned long value = Value1;
};
template < unsigned long Value1, unsigned long Value2 > struct static_lcm_helper_t {
static const unsigned long value = Value1 / static_gcd_helper_t<Value1, Value2>::value * Value2 ;
};
template < unsigned long Value1, unsigned long Value2 > struct static_lcm : public mpl::integral_c<unsigned long, static_lcm_helper_t<Value1, Value2>::value > {
};
namespace mpl {
template< bool C_, typename T1, typename T2, typename T3, typename T4 > struct and_impl : false_ {
};
template< typename T1 = na , typename T2 = na , typename T3 = true_, typename T4 = true_, typename T5 = true_ > struct and_ : and_impl< ::mpl::nested_type_wknd<mpl::not_<is_same<int, int> >>::value , int, int, int, int > {
};
template< typename Value > struct always {
template< typename T1 = na , typename T2 = na , typename T3 = na , typename T4 = na , typename T5 = na > struct apply {
typedef Value type;
};
};
template< typename Iterator, typename State > struct iter_fold_if_null_step {
typedef int state;
typedef int iterator;
};
template< bool > struct iter_fold_if_step_impl ;
template<> struct iter_fold_if_step_impl<false> {
template< typename Iterator , typename State , typename StateOp , typename IteratorOp > struct result_ {
typedef int state;
typedef int iterator;
};
};
template< typename Iterator , typename State , typename ForwardOp , typename Predicate > struct iter_fold_if_forward_step {
typedef typename apply2< Predicate,int,int >::type not_last;
typedef typename iter_fold_if_step_impl< not_last::value >::template result_< int,int,int, mpl::next<int> > impl_;
typedef typename impl_::state state;
typedef typename impl_::iterator iterator;
};
template< typename Iterator , typename State , typename BackwardOp , typename Predicate > struct iter_fold_if_backward_step {
typedef typename apply2< Predicate,int,int >::type not_last;
typedef typename iter_fold_if_step_impl< not_last::value >::template result_< int,int,int, identity<int> > impl_;
typedef typename impl_::state state;
};
template< typename Iterator , typename State , typename ForwardOp , typename ForwardPredicate , typename BackwardOp , typename BackwardPredicate > struct iter_fold_if_impl {
private: typedef iter_fold_if_null_step< int,int > forward_step0;
typedef iter_fold_if_forward_step< typename forward_step0::iterator, typename forward_step0::state, int, ForwardPredicate > forward_step1;
typedef iter_fold_if_forward_step< typename forward_step1::iterator, typename forward_step1::state, int, ForwardPredicate > forward_step2;
typedef iter_fold_if_forward_step< typename forward_step2::iterator, typename forward_step2::state, int, ForwardPredicate > forward_step3;
typedef iter_fold_if_forward_step< typename forward_step3::iterator, typename forward_step3::state, int, ForwardPredicate > forward_step4;
typedef typename if_< typename forward_step4::not_last , int , iter_fold_if_null_step< typename forward_step4::iterator , typename forward_step4::state > >::type backward_step4;
public: typedef typename iter_fold_if_backward_step<typename forward_step0::iterator, typename iter_fold_if_backward_step<typename forward_step1::iterator, typename iter_fold_if_backward_step<typename forward_step2::iterator, typename iter_fold_if_backward_step<typename forward_step3::iterator, typename backward_step4::state, int, BackwardPredicate>::state, int, BackwardPredicate>::state, int, BackwardPredicate>::state, int, BackwardPredicate>::state state;
typedef typename backward_step4::iterator iterator;
};
}
namespace mpl {
template< typename Predicate, typename LastIterator > struct iter_fold_if_pred {
template< typename State, typename Iterator > struct apply : and_< int , int > {
};
};
template< typename Sequence = na , typename State = na , typename ForwardOp = na , typename ForwardPredicate = na , typename BackwardOp = na , typename BackwardPredicate = na > struct iter_fold_if {
struct result_ : iter_fold_if_impl< int , int , int , protect< iter_fold_if_pred< int,int > > , mpl_::na , typename eval_if<is_na<mpl_::na>, if_<is_na<mpl_::na>, always<false_>, always<true_> >, identity<mpl_::na> >::type > {
};
public: typedef pair< typename result_::state , typename result_::iterator > type;
};
}
namespace mpl {
template< int N , typename First , typename Last , typename State , typename ForwardOp > struct fold_impl;
template< typename First , typename Last , typename State , typename ForwardOp > struct fold_impl< 1,First,Last,State,ForwardOp > {
typedef typename apply2<ForwardOp, State, typename deref<First>::type>::type state;
};
}
namespace mpl {
struct symbol;
template< typename Sequence = na , typename State = na , typename ForwardOp = na > struct fold {
typedef typename fold_impl< ::mpl::O1_size<mpl::l_item<int, int, int>>::value , typename begin<mpl::l_item<int, int, int>>::type , typename end<mpl::l_item<int, int, int>>::type , mpl_::size_t<1> , ForwardOp >::state type;
};
}
namespace mpl {
template< typename T = na > struct is_sequence : not_< is_same< typename begin<T>::type, int > > {
};
struct iterator_range_tag;
template< typename First = na , typename Last = na > struct iterator_range {
typedef int begin;
typedef int end;
};
}
namespace mpl {
template< typename F , typename Tag1 , typename Tag2 > struct cast1st_impl ;
template< typename F , typename Tag1 , typename Tag2 > struct cast2nd_impl ;
template< typename Tag1 , typename Tag2 > struct less_impl : if_c< ( Tag1::value > Tag2::value ) , cast2nd_impl< less_impl< Tag1,Tag1 >,Tag1, Tag2 > , cast1st_impl< less_impl< Tag2,Tag2 >,Tag1, Tag2 > >::type {
};
template< typename T > struct less_tag {
typedef typename T::tag type;
};
template< typename N1 = na , typename N2 = na > struct less : less_impl< typename less_tag<N1>::type , typename less_tag<N2>::type >::template apply< N1,N2 >::type {
};
}
namespace mpl {
template<> struct less_impl< integral_c_tag,integral_c_tag > {
template< typename N1, typename N2 > struct apply : bool_< ( N2::value > N1::value ) > {
};
};
}
namespace mpl {
template< typename Predicate > struct select_max {
template< typename OldIterator, typename Iterator > struct apply {
typedef typename apply2< Predicate , typename deref<OldIterator>::type , typename deref<Iterator>::type >::type condition_;
typedef OldIterator type;
};
};
template< typename Sequence = na , typename Predicate = less<arg<-1>,arg<-1>> > struct max_element : iter_fold< Sequence , typename begin<Sequence>::type , protect< select_max<Predicate> > > {
};
}
namespace mpl {
template< typename Sequence = na , typename T = na > struct push_front : push_front_impl< typename sequence_tag<Sequence>::type > ::template apply< Sequence,T > {
};
template<> struct push_front< na , na > {
template< typename T1 , typename T2 , typename T3 =na , typename T4 =na , typename T5 =na > struct apply : push_front< T1 , T2 > {
};
};
}
namespace mpl {
template< typename T1 > struct not_same_as ;
}
namespace mpl {
template< typename T = na > struct sizeof_ : mpl::size_t< sizeof(T) > {
};
}
namespace mpl {
template< long N , typename First , typename Last , typename State , typename BackwardOp , typename ForwardOp > struct reverse_fold_impl;
template< typename First , typename Last , typename State , typename BackwardOp , typename ForwardOp > struct reverse_fold_impl< 0,First,Last,State,BackwardOp,ForwardOp > ;
template< typename First , typename Last , typename State , typename BackwardOp , typename ForwardOp > struct reverse_fold_impl< 1,First,Last,State,BackwardOp,ForwardOp > {
typedef First iter0;
typedef typename apply2< BackwardOp, typename apply2<ForwardOp, State, typename deref<iter0>::type>::type, typename deref<iter0>::type >::type bkwd_state0;
typedef bkwd_state0 state;
};
template< typename Sequence = na , typename State = na , typename BackwardOp = na , typename ForwardOp = arg<1> > struct reverse_fold {
typedef typename reverse_fold_impl< ::mpl::O1_size<Sequence>::value , typename begin<Sequence>::type , typename end<Sequence>::type , State , BackwardOp , ForwardOp >::state type;
};
template< typename Sequence1 = na , typename Sequence2 = na > struct pair_view ;
struct has_push_back_arg ;
template< typename Tag > struct push_back_impl ;
template< typename Tag > struct has_push_back_impl {
template< typename Seq > struct apply : has_type< int > {
};
};
}
namespace mpl {
template< typename Sequence = na , typename T = na > struct push_back : push_back_impl< typename sequence_tag<Sequence>::type > ::template apply {
};
template< typename Sequence = na > struct has_push_back : has_push_back_impl< int > ::template apply< mpl::l_end > {
};
template< typename Sequence , typename Operation > struct inserter {
typedef Sequence state;
typedef Operation operation;
};
}
namespace mpl {
template< typename Sequence > struct back_inserter : inserter< int,int > {
};
template< typename Sequence > struct front_inserter : inserter< mpl::l_end,push_front<> > {
};
}
namespace mpl {
template< typename Sequence = na > struct clear : clear_impl< typename sequence_tag<Sequence>::type > ::template apply< Sequence > {
};
template< typename Seq , typename Op , typename In > struct transform1_impl : fold< Seq , typename In::state , bind2< typename lambda< typename In::operation >::type , _1 , bind1< typename lambda<Op>::type, arg<2>> > > {
};
template< typename Seq , typename Op , typename In > struct reverse_transform1_impl : reverse_fold< Seq , typename In::state , bind2< typename lambda< typename In::operation >::type , _1 , bind1< typename lambda<Op>::type, arg<2>> > > {
};
template< typename Seq1 , typename Seq2 , typename Op , typename In > struct transform2_impl : fold< pair_view<Seq1,Seq2> , typename In::state , bind2< typename lambda< typename In::operation >::type , _1 , bind2< typename lambda<Op>::type , bind1<first<>,arg<2>> , bind1<second<>,arg<2>> > > > {
};
template< typename P1 = na , typename P2 = na , typename P3 = na > struct transform1 : transform1_impl< int , int , P3> {
};
template< typename P1 , typename P2 > struct transform1< P1 , P2,na > : if_< has_push_back< typename clear<P1>::type> , transform1_impl< P1 , P2 , back_inserter< typename clear<P1>::type > > , reverse_transform1_impl< P1 , P2 , front_inserter< typename clear<P1>::type > > >::type {
};
template< typename P1 = na , typename P2 = na , typename P3 = na , typename P4 = na > struct transform2 : transform2_impl< int , int , int , P4> {
};
template< typename Seq1 = na , typename Seq2OrOperation = na , typename OperationOrInserter = na , typename Inserter = na > struct transform {
typedef int type;
};
}
namespace detail {
namespace variant {
template <typename Sequence, typename F> struct max_value {
private: typedef typename mpl::transform1<Sequence, F>::type transformed_;
typedef typename mpl::max_element<transformed_ >::type max_it;
public: typedef typename mpl::deref<max_it>::type type;
};
struct add_alignment {
template <typename State, typename Item> struct apply : mpl::size_t< ::static_lcm< State::value , ::alignment_of<int>::value >::value > {
};
};
class no_fallback_type;
struct find_fallback_type_pred ;
template <typename Types> struct find_fallback_type {
private: typedef int end_it;
typedef typename mpl::iter_fold_if< int , mpl::int_<0>, mpl::protect< mpl::next<> > , mpl::protect< find_fallback_type_pred > >::type first_result_;
typedef typename first_result_::second first_result_it;
typedef typename mpl::iter_fold_if< mpl::iterator_range< first_result_it,end_it > , typename first_result_::first, mpl::protect< mpl::next<> > , mpl::protect< mpl::not_same_as<blank> > >::type second_result_;
typedef typename second_result_::second second_result_it;
public: typedef typename mpl::eval_if< is_same< second_result_it,end_it > , mpl::if_< is_same< first_result_it,end_it > , mpl::pair< no_fallback_type,no_fallback_type > , first_result_ > , mpl::identity< second_result_ > >::type type;
};
template <typename Types, typename NeverUsesBackupFlag> struct make_storage {
private: typedef Types types;
typedef typename max_value< types, mpl::sizeof_<mpl::_1> >::type max_size;
typedef typename mpl::fold< types , int , add_alignment >::type max_alignment;
public: typedef ::aligned_storage< max_size::value , max_alignment::value > type;
};
struct destroyer : public static_visitor<> {
public: template <typename T> void internal_visit(T& operand, int) const noexcept {
operand.~T();
}
};
}
}
struct symbol;
template < typename T0_ , typename... TN > class variant {
private:
struct is_recursive_ : detail::variant::is_recursive_flag<int> {
};
typedef symbol unwrapped_T0_;
struct is_sequence_based_ : detail::variant::is_over_sequence<int> {
};
private: typedef typename mpl::eval_if< is_sequence_based_ , int , detail::variant::make_variant_list< unwrapped_T0_ , TN... > >::type specified_types;
private: typedef typename mpl::eval_if<is_recursive_, mpl::transform<specified_types, mpl::protect<detail::variant::quoted_enable_recursive<variant<int, TN...> > > >, mpl::identity<specified_types> >::type internal_types;
private: typedef typename detail::variant::find_fallback_type< internal_types >::type fallback_type_result_;
struct has_fallback_type_ : mpl::not_< is_same< typename fallback_type_result_::second, int > > {
};
typedef has_fallback_type_ never_uses_backup_flag;
private:
private: int which_;
typename detail::variant::make_storage<internal_types, int>::type storage_;
public: int which() const noexcept {
}
void destroy_content() noexcept {
detail::variant::destroyer visitor;
this->internal_apply_visitor(visitor);
}
public: ~variant() noexcept {
destroy_content();
}
private: template <typename Visitor, typename VoidPtrCV> static typename Visitor::result_type internal_apply_visitor_impl( int internal_which , int logical_which , Visitor& visitor , VoidPtrCV storage ) {
typedef mpl::int_<0> first_which;
typedef typename mpl::begin<internal_types>::type first_it;
typedef typename mpl::end<internal_types>::type last_it;
typedef detail::variant::visitation_impl_step< first_it, last_it > first_step;
return detail::variant::visitation_impl( internal_which, logical_which , visitor, storage, mpl::false_() , never_uses_backup_flag() , static_cast<first_which*>(0), static_cast<first_step*>(0) );
}
template <typename Visitor> typename Visitor::result_type internal_apply_visitor(Visitor& visitor) {
return internal_apply_visitor_impl( which_, which(), visitor, storage_.address() );
}
};
struct symbol {
virtual ~symbol();
};
using Identifier = variant<int>;
struct Fragment {
virtual void foo() const = 0;
virtual ~Fragment();
};
struct ProcFrag : Fragment {
~ProcFrag() {
}
virtual void foo() const override;
Identifier id;
};
struct Fragments {
~Fragments() {
delete x;
}
Fragment* x;
};
Fragments fragments;