Hey,
rather minimal reproducer on at least clang++ & libc++ 3.5 upto 6.0:
#include <string>
struct big { int bloat[4]; };
using big_string = std::basic_string<big>;
int main () {
big_string a;
for (int i = 0; i < 100; i++)
a += big {};
return 0;
}
$ clang++ -stdlib=libc++ reproducer.cpp
$ valgrind ./a.out
Lots of invalid writes, in practice causes segmentation faults.
Thanks in advance for fixing. The use case was ncurses' cchar_t.
Regards,
Přemysl Janouch