[Bug c++/51270] New: constness violation is accepted without any warning but leads to a required function call being eliminated during optimization

2011-11-22 Thread michiel_dewilde at agilent dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51270 Bug #: 51270 Summary: constness violation is accepted without any warning but leads to a required function call being eliminated during optimization Classification: Unclassified

[Bug c++/51270] constness violation is accepted without any warning but leads to a required function call being eliminated during optimization

2011-11-22 Thread michiel_dewilde at agilent dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51270 --- Comment #1 from Michiel De Wilde 2011-11-22 15:26:42 UTC --- Created attachment 25885 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=25885 preprocessed source code (*.ii)

[Bug c++/51270] missed warning about returning reference to temporary

2011-11-22 Thread michiel_dewilde at agilent dot com
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51270 --- Comment #6 from Michiel De Wilde 2011-11-22 18:20:44 UTC --- Hi Jonathan, thanks for the quick analysis. I did not realize that "char * &" and "char const * &" are not reference-compatible, leading to a temporary being introduced when initia