Possible bug in C++, can someone else verify?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



With a recent debian gcc (3.3.2 20030908) we can no longer compile a
bit of code with optimizations.  Can someone else verify that this
fails with 3.3.2 or a newer compiler?  3.3 seems to work perfectly for
me.

Is this valid C++?

----------8<-----------------------------
#include <vector>

struct blc_offset {
  long start;
};

int main(void) {
  std::vector<blc_offset> vec;
  blc_offset b_off;
  b_off.start = 1;
  vec.push_back( b_off );
  vec[0].start = vec[0].start == 0 ? 0 : vec[0].start - 1;    
}
---------------------->8-----------------


when compiled with v3.3 at -O3 it runs fine, on v3.3.2 (debian
pre-release) it hangs in stl_vector.h somewhere in the template.

                                      Thanks,
                                        Patrick.


-- 
Patrick Audley                          paudley@xxxxxxxxxxxxxxxxxxxx
Computational Biology & Bioinformatics  http://www.compbio.dundee.ac.uk
University of Dundee                    http://blackcat.ca
Dundee, Scotland                        +44 1382 348721


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux