File tree Expand file tree Collapse file tree 1 file changed +9
-7
lines changed
libcxx/test/std/containers/sequences/vector/vector.cons Expand file tree Collapse file tree 1 file changed +9
-7
lines changed Original file line number Diff line number Diff 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.
149154void 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 {
You can’t perform that action at this time.
0 commit comments