Hi All,

I recently committed a patch that uses a nested std::pair in the second 
argument.
It temporarily adds a second ranking variable for sorting and then later drops 
it.

This hits the newly added assert in vec.h.  This assert made some relaxation for
std::pair but doesn't allow this case through.  The patch allows a recursive
std::pair in the second argument which fixes bootstrap.

It should also still maintain the invariant that was being tested here since
the nested arguments should still be trivially copyable.

Bootstrapped on aarch64-none-linux-gnu, x86_64-linux-gnu, and no issues.

Ok for master?

Thanks,
Tamar

gcc/ChangeLog:

        vec.h (struct is_trivially_copyable_or_pair): Check recursively in
        second arg.

--- inline copy of patch -- 
diff --git a/gcc/vec.h b/gcc/vec.h
index d509639292b..dcc18c99bfb 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1199,7 +1199,7 @@ namespace vec_detail
   template<typename T, typename U>
   struct is_trivially_copyable_or_pair<std::pair<T, U> >
   : std::integral_constant<bool, std::is_trivially_copyable<T>::value
-    && std::is_trivially_copyable<U>::value> { };
+    && is_trivially_copyable_or_pair<U>::value> { };
 }
 #endif




-- 
diff --git a/gcc/vec.h b/gcc/vec.h
index d509639292b..dcc18c99bfb 100644
--- a/gcc/vec.h
+++ b/gcc/vec.h
@@ -1199,7 +1199,7 @@ namespace vec_detail
   template<typename T, typename U>
   struct is_trivially_copyable_or_pair<std::pair<T, U> >
   : std::integral_constant<bool, std::is_trivially_copyable<T>::value
-    && std::is_trivially_copyable<U>::value> { };
+    && is_trivially_copyable_or_pair<U>::value> { };
 }
 #endif



Reply via email to