This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/61597] Unexpected behavior at runtime


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

Adrien Hamelin <adrien.hamelin+gcc at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
  Attachment #33000|0                           |1
        is obsolete|                            |

--- Comment #8 from Adrien Hamelin <adrien.hamelin+gcc at gmail dot com> ---
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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]