[Bug c++/42758] New: ICE on assert() in function with complex(?) template argument

adl at gnu dot org gcc-bugzilla@gcc.gnu.org
Fri Jan 15 13:38:00 GMT 2010


The following code compiles fine with g++-4.4 and causes g++-4.5 to segfault.
Removing the assert() or removing the int_less_than parameter no longer lead
to a segfault.

% g++-4.5 --version
g++-4.5 (Debian 4.5-20091226-1) 4.5.0 20091226 (experimental) [trunk revision
155473]
Copyright (C) 2009 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
% cat bug.cc
#include <cassert>
#include <set>

namespace spot
{
  struct int_less_than
  {
    bool operator()(int, int) const { return 0; }
  };

  int f(const std::set<int, int_less_than>&)
  {
    assert(0);
    return 1;
  }
}
% g++-4.4 -c bug.cc    # 4.4 runs OK
% g++-4.5 -c bug.cc
g++-4.5: Internal error: Segmentation fault (program cc1plus)
Please submit a full bug report.
See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions.


-- 
           Summary: ICE on assert() in function with complex(?) template
                    argument
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: adl at gnu dot org
 GCC build triplet: i686-linux-gnu
  GCC host triplet: i686-linux-gnu
GCC target triplet: i486-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42758



More information about the Gcc-bugs mailing list