From a73ac7d932e193f02c5a115be9d83d6778cf6560 Mon Sep 17 00:00:00 2001 From: Marshall Clow Date: Fri, 22 Mar 2019 00:49:41 +0000 Subject: [PATCH] Fix a vector test to not use a local type as a template parameter. This causes a warning on C++03. NFC llvm-svn: 356726 --- .../vector/vector.cons/construct_iter_iter.pass.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp index 8f8ffa8..28c51eb 100644 --- a/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp +++ b/libcxx/test/std/containers/sequences/vector/vector.cons/construct_iter_iter.pass.cpp @@ -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 v(array, array + 1); + std::vector v(array, array + 1); assert(v[0] == &z); } { -- 2.7.4