[Bug c++/61512] New: libstd++ postfix operator hangs

2014-06-15 Thread srohit.pda at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61512

Bug ID: 61512
   Summary: libstd++ postfix operator hangs
   Product: gcc
   Version: 4.4.7
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: srohit.pda at gmail dot com

Created attachment 32942
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32942&action=edit
testcase files- source code, pre-processed code, assembly code, object code and
executable

Following code hangs forever in postfix operator.


#include 
#include 

int main()
{
  std::set empty;
  std::set::iterator iter = empty.begin() ;
  while (iter++ != empty.end())
  {
std::cout << *iter << "\n";
  }
  return 0;
}


[Bug c++/61512] libstd++ postfix operator hangs

2014-06-15 Thread srohit.pda at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61512

--- Comment #2 from Rohit Sharma  ---
(In reply to Marc Glisse from comment #1)
> You are not allowed to call ++ on an iterator if calling * on it would be
> illegal.

I may agree to your comment Marc. 

Hanging code is manifestation is a sure bug - either in libstdc++ or gcc. Do
you agree?


[Bug c++/61512] libstd++ postfix operator hangs

2014-06-16 Thread srohit.pda at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61512

--- Comment #5 from Rohit Sharma  ---
Thank you Marc for the flag.

Compiling with that flag and running it, code "abort (core dumped)" - which I
take is reasonable behavior on a bad code.

bests.
-Rohit


[Bug c++/61512] libstd++ postfix operator hangs

2014-06-16 Thread srohit.pda at gmail dot com
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61512

--- Comment #7 from Rohit Sharma  ---
Yes, it did print that message clearly before core-dump.

thank you much.
-Rohit