[Bug c++/64372] Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread manu at gcc dot gnu.org
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 Manuel López-Ibáñez manu at gcc dot gnu.org changed: What|Removed |Added CC||glisse at

[Bug c++/64372] Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread harald at gigawatt dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 Harald van Dijk harald at gigawatt dot nl changed: What|Removed |Added CC||harald at

[Bug c++/64372] Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread harald at gigawatt dot nl
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 --- Comment #3 from Harald van Dijk harald at gigawatt dot nl --- BTW, *(ptr ? ptr : throw ptr) would be fine, would not create any temporary, in any of the language standards.

[Bug c++/64372] Spurious warning with throw in ternary operator returning const reference

2014-12-21 Thread tavianator at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=64372 --- Comment #4 from Tavian Barnes tavianator at gmail dot com --- I meant to include -std=c++11 in the OP, it still happens with that flag set. Good suggestion for the replacement though. The actual code was closer to i length ? a[i] : throw