File tree 1 file changed +9
-7
lines changed
libcxx/test/std/containers/sequences/vector/vector.cons
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() {
145
145
#endif
146
146
}
147
147
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
+
148
153
// Initialize a vector with a different value type.
149
154
void test_ctor_with_different_value_type () {
150
155
{
@@ -156,15 +161,12 @@ void test_ctor_with_different_value_type() {
156
161
assert (v[1 ] == 1 );
157
162
assert (v[2 ] == 2 );
158
163
}
159
- struct X { int x; };
160
- struct Y { int y; };
161
- struct Z : X, Y { int z; };
162
164
{
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
166
168
// be done with `memcpy`.
167
- std::vector<Y *> v (array, array + 1 );
169
+ std::vector<B2 *> v (array, array + 1 );
168
170
assert (v[0 ] == &z);
169
171
}
170
172
{
You can’t perform that action at this time.
0 commit comments