This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/57870] New: Internal compiler error in use of emplace
- From: "eyakubovich at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Tue, 09 Jul 2013 20:18:39 +0000
- Subject: [Bug c++/57870] New: Internal compiler error in use of emplace
- Auto-submitted: auto-generated
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=57870
Bug ID: 57870
Summary: Internal compiler error in use of emplace
Product: gcc
Version: 4.7.3
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: eyakubovich at gmail dot com
In the following code, S lacks a constructor that accepts an int. Subsequently,
g++ crashes on use of emplace:
#include <queue>
struct S {
int x;
friend bool operator<(S const&, S const&) { return false; }
};
int main() {
std::priority_queue<S> q;
q.emplace(1);
return 0;
}
A similar problem occurs with use of std::vector, however a correct error is
first issued:
#include <vector>
struct S {
int x;
};
int main() {
std::vector<S> q;
q.emplace(q.begin(), 1);
return 0;
}