[gcc r14-4348] vec.h: Uncomment static_assert

Jakub Jelinek jakub@gcc.gnu.org
Sat Sep 30 09:28:16 GMT 2023


https://gcc.gnu.org/g:9d249b7e31eb4e1379a45f90949776c11d29063c

commit r14-4348-g9d249b7e31eb4e1379a45f90949776c11d29063c
Author: Jakub Jelinek <jakub@redhat.com>
Date:   Sat Sep 30 11:26:14 2023 +0200

    vec.h: Uncomment static_assert
    
    Now that poly_int_pod has been removed and other changes mostly to use
    {quick,safe}_grow_cleared instead of {quick,safe}_grow for types with
    non-trivial default construction, we can enable even the last static
    assertion.  From now on, {quick,safe}_grow can only be used with
    trivially default constructible types.
    
    2023-09-30  Jakub Jelinek  <jakub@redhat.com>
    
            * vec.h (quick_grow): Uncomment static_assert.

Diff:
---
 gcc/vec.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gcc/vec.h b/gcc/vec.h
index 42eac1c0e1d..d509639292b 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1416,7 +1416,7 @@ vec<T, A, vl_embed>::quick_grow (unsigned len)
 {
   gcc_checking_assert (length () <= len && len <= m_vecpfx.m_alloc);
 #if GCC_VERSION >= 5000
-//  static_assert (std::is_trivially_default_constructible <T>::value, "");
+  static_assert (std::is_trivially_default_constructible <T>::value, "");
 #endif
   m_vecpfx.m_num = len;
 }


More information about the Gcc-cvs mailing list