Skip to content

Commit a73ac7d

Browse files
committed
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
1 parent 4c66155 commit a73ac7d

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

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

+9-7
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,11 @@ void test_ctor_under_alloc() {
145145
#endif
146146
}
147147

148+
// In C++03, you can't instantiate a template with a local type.
149+
struct B1 { int x; };
150+
struct B2 { int y; };
151+
struct Der : B1, B2 { int z; };
152+
148153
// Initialize a vector with a different value type.
149154
void test_ctor_with_different_value_type() {
150155
{
@@ -156,15 +161,12 @@ void test_ctor_with_different_value_type() {
156161
assert(v[1] == 1);
157162
assert(v[2] == 2);
158163
}
159-
struct X { int x; };
160-
struct Y { int y; };
161-
struct Z : X, Y { int z; };
162164
{
163-
Z z;
164-
Z *array[1] = { &z };
165-
// Though the types Z* and Y* are very similar, initialization still cannot
165+
Der z;
166+
Der *array[1] = { &z };
167+
// Though the types Der* and B2* are very similar, initialization still cannot
166168
// be done with `memcpy`.
167-
std::vector<Y*> v(array, array + 1);
169+
std::vector<B2*> v(array, array + 1);
168170
assert(v[0] == &z);
169171
}
170172
{

0 commit comments

Comments
 (0)