Skip to content

Commit a382707

Browse files
committed
Fixes for cv-qualified arrays
Combined type_traits_castxml.hpp and type_traits_gccxml.hpp into a single file - type_traits.hpp. Disabled tests for const volatile arrays for gccxml, these are incorrectly being detected a non-const; this needs to be looked into. Disabled tests for "has_trivial_constructor" for gccxml, these are being detected as False, while castxml detects them as True. At this time I'm not sure which one is correct; need to look into this as well. Change-Id: I27ef6d370964e50ea745e972dfcd777e48b7c566
1 parent 69ca00c commit a382707

File tree

3 files changed

+12
-880
lines changed

3 files changed

+12
-880
lines changed

unittests/data/type_traits_castxml.hpp renamed to unittests/data/type_traits.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
typedef BASE volatile NAME##_volatile_t; \
2020
typedef BASE const volatile NAME##_const_volatile_t;
2121

22+
2223
struct some_struct_t{
2324
void do_smth();
2425
int member;
@@ -47,9 +48,7 @@ struct incomplete_type;
4748

4849
namespace is_void{
4950
namespace yes{
50-
typedef void void_t;
51-
typedef void const void_cont_t;
52-
typedef void volatile void_volatile_t;
51+
TYPE_PERMUTATION( void, void )
5352
}
5453
namespace no{
5554
typedef void* void_ptr_t;
@@ -186,6 +185,8 @@ namespace yes{
186185
typedef detail::dd_t dd_t;
187186
typedef detail::f_t f_t;
188187
typedef detail::g_t g_t;
188+
typedef detail::const_container const_container_t;
189+
typedef detail::const_item const_item_t;
189190

190191
}
191192
namespace no{
@@ -195,8 +196,6 @@ namespace no{
195196
typedef std::set< std::string > string_set_type;
196197
typedef std::multimap< std::string, std::string > s2s_multimap_type;
197198
typedef detail::vertex vertex_type;
198-
// typedef detail::const_item const_item_t;
199-
// typedef detail::const_container const_container_t;
200199
}
201200
}
202201

@@ -286,11 +285,6 @@ namespace no{
286285
namespace is_fundamental{
287286
namespace yes{
288287

289-
#define FUNDAMENTAL_TYPE_PERMUTATION( BASE, NAME ) \
290-
typedef BASE NAME##_t; \
291-
typedef BASE const NAME##_const_t; \
292-
typedef BASE volatile NAME##_volatile_t;
293-
294288
TYPE_PERMUTATION( void, void )
295289
TYPE_PERMUTATION( bool, bool )
296290
TYPE_PERMUTATION( char, char )
@@ -410,7 +404,6 @@ namespace yes{
410404
typedef int* const int_const_t;
411405
typedef int* volatile const int_volatile_const_t;
412406
typedef int* const volatile int_const_volatile_t;
413-
//TODO typedef const int& const_int_ref_t;
414407
}
415408

416409
namespace no{
@@ -422,6 +415,7 @@ namespace no{
422415
typedef void(*function_t)();
423416
typedef void (some_struct_t::*member_function_t)();
424417
typedef int int_t;
418+
typedef const int& const_int_ref_t;
425419
} }
426420

427421
namespace remove_const{
@@ -436,8 +430,10 @@ namespace before{
436430
typedef char arr_42[42];
437431
typedef char const arr_c_42[42];
438432
typedef char volatile arr_v_42[42];
433+
#ifdef __castxml__
439434
typedef char const volatile arr_cv_42[42];
440435
typedef char volatile const arr_vc_42[42];
436+
#endif
441437
}
442438

443439
namespace after{
@@ -450,8 +446,10 @@ namespace after{
450446
typedef char arr_42[42];
451447
typedef char arr_c_42[42];
452448
typedef char volatile arr_v_42[42];
449+
#ifdef __castxml__
453450
typedef char volatile arr_cv_42[42];
454451
typedef char volatile arr_vc_42[42];
452+
#endif
455453
} }
456454

457455
namespace is_volatile{
@@ -588,8 +586,10 @@ namespace yes{
588586
struct x{
589587
x(){}
590588
};
589+
#ifdef __castxml__
591590
typedef details::const_item const_item;
592591
typedef details::const_container const_container;
592+
#endif
593593
}
594594

595595
namespace no{

0 commit comments

Comments
 (0)