public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/14006] New: Using "typedef typename std::iterator difference_type" causes a segfault.
@ 2004-02-03 19:51 gcc-bugzilla at gcc dot gnu dot org
  2004-02-03 19:59 ` [Bug c++/14006] " pinskia at gcc dot gnu dot org
  2004-02-03 20:01 ` pinskia at gcc dot gnu dot org
  0 siblings, 2 replies; 3+ messages in thread
From: gcc-bugzilla at gcc dot gnu dot org @ 2004-02-03 19:51 UTC (permalink / raw)
  To: gcc-bugs

$ g++ -o test test.cc
test.cc:24: internal compiler error: Segmentation fault
Please submit a full bug report,
with preprocessed source if appropriate.
See <URL:http://gcc.gnu.org/bugs.html> for instructions.

Environment:
System: Linux wrynose 2.6.1 #3 Tue Jan 20 23:27:03 GMT 2004 i686 GNU/Linux
Architecture: i686

	
host: i486-pc-linux-gnu
build: i486-pc-linux-gnu
target: i486-pc-linux-gnu
configured with: ../src/configure -v --enable-languages=c,c++,java,f77,pascal,objc,ada,treelang --prefix=/usr --mandir=/usr/share/man --infodir=/usr/share/info --with-gxx-include-dir=/usr/include/c++/3.3 --enable-shared --with-system-zlib --enable-nls --without-included-gettext --enable-__cxa_atexit --enable-clocale=gnu --enable-debug --enable-java-gc=boehm --enable-java-awt=xlib --enable-objc-gc i486-linux

How-To-Repeat:
    1	#include <iterator>
    2	
    3	template<typename T>
    4	class myclass
    5	{
    6	private:
    7	  T m_value;
    8	public:
    9	  myclass(T& value): m_value(value) {}
   10	
   11	  class myiter : public std::iterator<std::random_access_iterator_tag, T, std::size_t>
   12	  {
   13	  public:
   14	    typedef std::size_t size_type;
   15	    typedef typename std::iterator difference_type;
   16	
   17	  private:
   18	    size_type m_pos;
   19	
   20	    myiter(size_type pos): m_pos(pos) {}
   21	
   22	  public:
   23	    myiter operator + (difference_type incr)
   24	    {
   25	      size_type pos = m_pos;
   26	      if (pos + incr < m_result->size())
   27		pos += incr;
   28	      else
   29		pos = m_result->size();
   30	      return myiter(*m_result, pos);
   31	    }
   32	  };
   33	};
   34	
   35	int main()
   36	{
   37	  myclass<int> i;
   38	  return 0;
   39	}
------- Additional Comments From rleigh at debian dot org  2004-02-03 19:51 -------
Fix:
None, sorry.

-- 
           Summary: Using "typedef typename std::iterator difference_type"
                    causes a segfault.
           Product: gcc
           Version: 3.3
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: rleigh at debian dot org
                CC: gcc-bugs at gcc dot gnu dot org
 GCC build triplet: i486-pc-linux-gnu
  GCC host triplet: i486-pc-linux-gnu
GCC target triplet: i486-pc-linux-gnu


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/14006] Using "typedef typename std::iterator difference_type" causes a segfault.
  2004-02-03 19:51 [Bug c++/14006] New: Using "typedef typename std::iterator difference_type" causes a segfault gcc-bugzilla at gcc dot gnu dot org
@ 2004-02-03 19:59 ` pinskia at gcc dot gnu dot org
  2004-02-03 20:01 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-03 19:59 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2004-02-03 19:59 -------
Fixed for 3.4.0.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
           Keywords|                            |ice-on-invalid-code
      Known to work|                            |3.4.0 3.5.0
         Resolution|                            |FIXED


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug c++/14006] Using "typedef typename std::iterator difference_type" causes a segfault.
  2004-02-03 19:51 [Bug c++/14006] New: Using "typedef typename std::iterator difference_type" causes a segfault gcc-bugzilla at gcc dot gnu dot org
  2004-02-03 19:59 ` [Bug c++/14006] " pinskia at gcc dot gnu dot org
@ 2004-02-03 20:01 ` pinskia at gcc dot gnu dot org
  1 sibling, 0 replies; 3+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2004-02-03 20:01 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |3.4.0


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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2004-02-03 20:01 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-02-03 19:51 [Bug c++/14006] New: Using "typedef typename std::iterator difference_type" causes a segfault gcc-bugzilla at gcc dot gnu dot org
2004-02-03 19:59 ` [Bug c++/14006] " pinskia at gcc dot gnu dot org
2004-02-03 20:01 ` pinskia at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).