From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20096 invoked by alias); 30 Apr 2014 12:29:49 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 20041 invoked by uid 48); 30 Apr 2014 12:29:44 -0000 From: "stanislav.manilov at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/60081] Internal compiler error: Error reporting routines re-entered. Date: Wed, 30 Apr 2014 12:29:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 4.7.3 X-Bugzilla-Keywords: X-Bugzilla-Severity: major X-Bugzilla-Who: stanislav.manilov at gmail dot com X-Bugzilla-Status: UNCONFIRMED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-SW-Source: 2014-04/txt/msg02259.txt.bz2 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60081 --- Comment #4 from Stan Manilov --- Here is a simple way to reproduce the bug: ============================== #include #include int main() { std::vector> v; std::unique_ptr px(new int (1)); v.push_back(px); } ============================== There is a bug in the code: push_back tries to copy the given element by default. This should return an error along the lines of "Call to deleted copy constructor of std::unique_ptr". Instead it gives ICE. A solution to the bug in the code is to explicitly call std::move like so: ============================== #include #include int main() { std::vector> v; std::unique_ptr px(new int (1)); v.push_back(std::move(px)); } ==============================