https://gcc.gnu.org/bugzilla/show_bug.cgi?id=77744
--- Comment #6 from morandidodo at gmail dot com --- (In reply to Jakub Jelinek from comment #5) > Pedantically this isn't valid, because you are mixing C++11 features > (lambdas) with OpenMP, which doesn't support C++11 even in 4.5, so it is all > unspecified behavior. > > Also, have you built libgomp with -fsanitize=thread after configuring it > with --disable-linux-futex (otherwise libtsan doesn't understand the > barriers etc. in libgomp)? I was not aware of possible issues between OpenMP and C++11/14 lambda features. However, in this case, the content of f can be inlined inside the loop, and the result is the same. Furthermore, you can try to construct other kind of object, but I am only getting this data race when using std::regex_iterator (however the empty constructor works fine). If you try with other "simpler" objects that allocates memory on the heap (just a simple std::vector<std::string>(10, "test") ), the data race is not triggered.