[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread theemathas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 --- Comment #8 from theemathas at hotmail dot com --- (In reply to Jonathan Wakely from comment #7) > If you change it to: > > const int& aa = std::abs(a); > const int& foo=std::max(aa, aa); > > You'll see that the problem goes away

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 --- Comment #7 from Jonathan Wakely --- If you change it to: const int& aa = std::abs(a); const int& foo=std::max(aa, aa); You'll see that the problem goes away because the value returned by std::abs gets its lifetime extended, then std

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread theemathas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 --- Comment #5 from theemathas at hotmail dot com --- Created attachment 33100 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33100&action=edit "main.ii.gz" preprocessed and compressed code Since the "main.ii" file exceeds the 1000 KB limit

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread theemathas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 theemathas at hotmail dot com changed: What|Removed |Added CC||redi at gcc dot gnu.org

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread theemathas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 theemathas at hotmail dot com changed: What|Removed |Added Status|RESOLVED|UNCONFIRMED Resol

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 Jonathan Wakely changed: What|Removed |Added Status|UNCONFIRMED |RESOLVED Resolution|---

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread redi at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 --- Comment #2 from Jonathan Wakely --- (In reply to theemathas from comment #1) > I am having some problems with uploading the "main.ii" file (apparently it > is too big because I #include 3 standard libraries). I am uploading the > non-preproce

[Bug c++/61769] const reference value is changed to random by a range-for loop

2014-07-10 Thread theemathas at hotmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61769 theemathas at hotmail dot com changed: What|Removed |Added CC||theemathas at hotmail dot