Created attachment 33529 [details] Preprocessed source The following file gives a "confused by earlier errors, bailing out" error message, with no previous errors printed, when compiled with -fsanitize=undefined: $ cat confused.cpp #include <memory> #include <map> int main() { std::unique_ptr<int> ptr{new int}; std::map<int, std::unique_ptr<int>> map; map.insert({0, std::move(ptr)}); return 0; } $ g++ -std=c++11 -fsanitize=undefined confused.cpp ‘ /usr/include/c++/4.9.1/ext/new_allocator.h:120: confused by earlier errors, bailing out Without the -fsanitize=undefined, it points to the actual error, which is fixed by using std::make_pair instead of a braced initializer as the argument to insert().
Confirmed. Trunk prints the full error though.
This is a dup of PR61272 , Marek, can you please apply your PR61272 patch to 4.9 branch too? Thanks.
On it.
Author: mpolacek Date: Mon Sep 22 11:27:54 2014 New Revision: 215459 URL: https://gcc.gnu.org/viewcvs?rev=215459&root=gcc&view=rev Log: PR c++/63323 * ubsan.c (is_ubsan_builtin_p): Turn assert into a condition. * g++.dg/ubsan/pr61272.C: New test. Added: branches/gcc-4_9-branch/gcc/testsuite/g++.dg/ubsan/pr61272.C Modified: branches/gcc-4_9-branch/gcc/ChangeLog branches/gcc-4_9-branch/gcc/testsuite/ChangeLog branches/gcc-4_9-branch/gcc/ubsan.c
Should be fixed.