https://llvm.org/bugs/show_bug.cgi?id=30449
Bug ID: 30449 Summary: Segfault when move-assigning a std::map with an aligned Key Product: clang Version: 3.8 Hardware: PC OS: All Status: NEW Severity: normal Priority: P Component: C++ Assignee: unassignedclangb...@nondot.org Reporter: gael.guenneb...@gmail.com CC: dgre...@apple.com, llvm-bugs@lists.llvm.org Classification: Unclassified The following example segfault with clang 3.8 and 3.9 when compiling with -O2 or -O3 (but runs fine with clang 3.7 and gcc): #include <iostream> #include <map> struct alignas(16) Foo { int val; }; int main() { std::map<int, Foo> m; std::map<int, Foo> n{{1,{1}}}; std::cout << "GOT HERE" << std::endl; m = std::move(n); // segfault happens here std::cout << "GOT HERE TOO" << std::endl; } Removing "alignas(16)" or "std::move" disables the issue. Finally, here is the backtrace: frame #0: 0x00000001000014f5 a.out`main [inlined] std::__1::__tree<std::__1::__value_type<int, Foo>, std::__1::__map_value_compare<int, std::__1::__value_type<int, Foo>, std::__1::less<int>, true>, std::__1::allocator<std::__1::__value_type<int, Foo> > >::__move_assign(this=<unavailable>) + 67 at __tree:1350 [opt] frame #1: 0x00000001000014b2 a.out`main [inlined] std::__1::__tree<std::__1::__value_type<int, Foo>, std::__1::__map_value_compare<int, std::__1::__value_type<int, Foo>, std::__1::less<int>, true>, std::__1::allocator<std::__1::__value_type<int, Foo> > >::operator=(this=<unavailable>) at __tree:1409 [opt] frame #2: 0x00000001000014b2 a.out`main [inlined] std::__1::map<int, Foo, std::__1::less<int>, std::__1::allocator<std::__1::pair<int const, Foo> > >::operator=(this=<unavailable>) at map:961 [opt] -- You are receiving this mail because: You are on the CC list for the bug.
_______________________________________________ llvm-bugs mailing list llvm-bugs@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs