[libcxx-commits] [libcxx] r356726 - Fix a vector test to not use a local type as a template parameter. This causes a warning on C++03. NFC

Marshall Clow via libcxx-commits libcxx-commits at lists.llvm.org
Thu Mar 21 17:49:41 PDT 2019


Author: marshall
Date: Thu Mar 21 17:49:41 2019
New Revision: 356726

URL: http://llvm.org/viewvc/llvm-project?rev=356726&view=rev
Log:
Fix a vector test to not use a local type as a template parameter. This causes a warning on C++03. NFC

Modified:
    libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp

Modified: libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp?rev=356726&r1=356725&r2=356726&view=diff
==============================================================================
--- libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp (original)
+++ libcxx/trunk/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp Thu Mar 21 17:49:41 2019
@@ -145,6 +145,11 @@ void test_ctor_under_alloc() {
 #endif
 }
 
+// In C++03, you can't instantiate a template with a local type.
+struct B1 { int x; };
+struct B2 { int y; };
+struct Der : B1, B2 { int z; };
+
 // Initialize a vector with a different value type.
 void test_ctor_with_different_value_type() {
   {
@@ -156,15 +161,12 @@ void test_ctor_with_different_value_type
     assert(v[1] == 1);
     assert(v[2] == 2);
   }
-  struct X { int x; };
-  struct Y { int y; };
-  struct Z : X, Y { int z; };
   {
-    Z z;
-    Z *array[1] = { &z };
-    // Though the types Z* and Y* are very similar, initialization still cannot
+    Der z;
+    Der *array[1] = { &z };
+    // Though the types Der* and B2* are very similar, initialization still cannot
     // be done with `memcpy`.
-    std::vector<Y*> v(array, array + 1);
+    std::vector<B2*> v(array, array + 1);
     assert(v[0] == &z);
   }
   {




More information about the libcxx-commits mailing list