https://gcc.gnu.org/bugzilla/show_bug.cgi?id=63323

            Bug ID: 63323
           Summary: "confused by earlier errors, bailing out" with no
                    other errors
           Product: gcc
           Version: 4.9.1
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tavianator at gmail dot com

Created attachment 33529
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33529&action=edit
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().

Reply via email to