-
- Downloads
vec.h: Guard most of static assertions for GCC >= 5
As reported by Jonathan on IRC, my vec.h patch broke build with GCC 4.8.x or 4.9.x as system compiler, e.g. on CFarm. The problem is that while all of std::is_trivially_{destructible,copyable,default_constructible} traits are in C++, only std::is_trivially_destructible has been implemented in GCC 4.8, the latter two were added only in GCC 5. Only std::is_trivially_destructible is the really important one though, which is used to decide what pop returns and whether to invoke the destructors or not. The rest are solely used in static_asserts and as such I think it is acceptable if we don't assert those when built with GCC 4.8 or 4.9, anybody doing bootstrap from those system compilers or doing builds with newer GCC will catch that. So, the following patch guards those for 5+. If we switch to C++14 later on and start requiring newer version of system GCC as well (do we require GCC >= 5 which claims the last C++14 language features, or what provides all C++14 library features, or GCC >= 6 which uses -std=c++14 by default?), this patch then can be reverted. 2023-09-29 Jakub Jelinek <jakub@redhat.com> * vec.h (quick_insert, ordered_remove, unordered_remove, block_remove, qsort, sort, stablesort, quick_grow): Guard std::is_trivially_{copyable,default_constructible} and vec_detail::is_trivially_copyable_or_pair static assertions with GCC_VERSION >= 5000. (vec_detail::is_trivially_copyable_or_pair): Guard definition with GCC_VERSION >= 5000.
Loading
Please register or sign in to comment