From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25633 invoked by alias); 25 Jun 2014 08:22:36 -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 25586 invoked by uid 48); 25 Jun 2014 08:22:31 -0000 From: "adrien.hamelin+gcc at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/61597] Unexpected behavior at runtime Date: Wed, 25 Jun 2014 08:22: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.9.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: adrien.hamelin+gcc 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: attachments.isobsolete attachments.created 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-06/txt/msg01931.txt.bz2 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61597 Adrien Hamelin changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #33000|0 |1 is obsolete| | --- Comment #8 from Adrien Hamelin --- Created attachment 33002 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33002&action=edit Preprocessed file Effectively the problem can be showed with much less code lines. I just did a custom iterator to show the problem (and removed my own array). The problem comes from line 45. If the function takes a copy, it does not work but if it takes a reference and do the copy inside (as shown line 52) it does work. Once again it works fine with Visual 2013. The new code : http://coliru.stacked-crooked.com/a/e33afe532e7f1e55