aboutsummaryrefslogtreecommitdiff
path: root/gcc/function.h
diff options
context:
space:
mode:
authorJakub Jelinek <jakub@redhat.com>2023-09-29 15:14:52 +0200
committerJakub Jelinek <jakub@redhat.com>2023-09-29 15:14:52 +0200
commite40f3301019a521b11bfcc25aeb1388e6da1ca2f (patch)
tree09aac686e3cc66a516a2e3c7d68ea97502970ce7 /gcc/function.h
parenta680274616ec6b26ccfdcee400ed7f54e341d40c (diff)
downloadgcc-e40f3301019a521b11bfcc25aeb1388e6da1ca2f.zip
gcc-e40f3301019a521b11bfcc25aeb1388e6da1ca2f.tar.gz
gcc-e40f3301019a521b11bfcc25aeb1388e6da1ca2f.tar.bz2
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.
Diffstat (limited to 'gcc/function.h')
0 files changed, 0 insertions, 0 deletions