Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
9 Views

test_concurrent_vector bug or trick ?

Hello.

This code comes from test_concurrent_vector.cpp (tbb40_20111130):

template
void TestVectorTypes() {
tbb::concurrent_vector v;
for( int i=0; i<100; ++i ) {
// VC8 does not properly align a temporary value; to work around, use explicit variable
ClassWithVectorType foo(i);
v.push_back(foo);
for( int j=0; i
ClassWithVectorType bar(j);
ASSERT( v==bar, NULL );
}
}
}
Is the self-comparison (i
It is here at least since vers tbb30_20100406.
I found it because it throws a warning when compiling with clang.
0 Kudos
3 Replies
Highlighted
Black Belt
9 Views

It's a bug (the test should be for j
The comment about alignment is a bit intriguing...
0 Kudos
Highlighted
9 Views

Yes there are more, and I'll post it in 15 minutes (more or less)

I'm not sure if gcc must throw this warning, but the others I've found are warnings that gcc missed and theoretically must throw.

0 Kudos
Highlighted
Employee
9 Views

Thank you very much for catching and reporting it.
it is definitely a bug that have to be fixed.

If you have more issues of the type you are very welcome to post it.
0 Kudos