[Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG

2007-03-17 Thread pinskia at gcc dot gnu dot org
--- Comment #1 from pinskia at gcc dot gnu dot org 2007-03-17 16:58 --- Lets look at the IR: ;; Function __gnu_debug::_Safe_iterator_Iterator, _Sequence::_Safe_iterator() [with _Iterator = __gnu_cxx::__normal_iteratorint*, __gnu_norm::vectorint, std::allocatorint , _Sequence =

[Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG

2007-03-17 Thread sylvain dot pion at sophia dot inria dot fr
--- Comment #2 from sylvain dot pion at sophia dot inria dot fr 2007-03-17 17:26 --- Trying further, I noticed that simply default constructing an std::vectorint, even without the debug mode _GLIBCXX_DEBUG, generates also a bunch (14 !) of these warnings. Andrew, I did not follow all

[Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG

2007-03-17 Thread chris at bubblescope dot net
--- Comment #3 from chris at bubblescope dot net 2007-03-17 17:46 --- This is a general problem I've come across with templates. You commonly want to try/catch around some operation, but when you have templated on a simple type, like int, then it's easy to find out that no throwing can

[Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG

2007-03-17 Thread chris at bubblescope dot net
--- Comment #4 from chris at bubblescope dot net 2007-03-17 18:07 --- Here is a minimal code example: #include new int* get_ptr(void* ptr) { return new(ptr) int(); } Which gives (on my computer) /usr/include/c++/4.0.0/new: In function 'int* get_ptr(void*)':

[Bug libstdc++/31246] Strange -Wunreachable-code warning with _GLIBCXX_DEBUG

2007-03-17 Thread pcarlini at suse dot de
--- Comment #5 from pcarlini at suse dot de 2007-03-17 20:40 --- Note, however, that, as far as I can see, such try/catch are *not* in the library code proper, but *all* synthesized by the C++ front-end. Is it so weird to imagine for the C++ front-end to automatically suppress warning