public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/16154] New: input iterator concept too restrictive
@ 2004-06-23  9:16 cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-06-23  9:30 ` [Bug libstdc++/16154] " cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (7 more replies)
  0 siblings, 8 replies; 9+ messages in thread
From: cludwig at cdc dot informatik dot tu-darmstadt dot de @ 2004-06-23  9:16 UTC (permalink / raw)
  To: gcc-bugs

The input iterator concept checks performed if std::copy is called are too 
restrictive. Neither in section 24.1.1 nor in section 25.2 of the C++ standard 
I see any requirement that input iterators have to be default constructible. 
But the compilation of the following program fails anyway due to a failed 
DefaultConstructibleConcept check. 
 
cludwig@lap200:~/C++/gcc3.4/tmp> cat input-iterator.cc 
#include <iterator> 
#include <string> 
#include <iostream> 
#include <algorithm> 
 
class myInputIterator : public std::iterator<std::input_iterator_tag, char> { 
  std::string data; 
 
public: 
  // past-the-end iterators can be constructed 
  // by myInputIterator("") 
  explicit myInputIterator(std::string const& input) 
    : data(input) { 
  } 
 
  value_type operator*() { 
    return data.at(data.length() - 1); 
  } 
 
  myInputIterator& operator++() { 
    if(!data.empty()) { 
      data.resize(data.length() - 1); 
    } 
    return *this; 
  } 
 
  myInputIterator operator++(int) { 
    myInputIterator result(*this); 
    ++(*this); 
    return result; 
  } 
 
  friend bool operator==(myInputIterator const& lhs, 
                         myInputIterator const& rhs); 
}; 
 
 
bool operator==(myInputIterator const& lhs, myInputIterator const& rhs) { 
  return lhs.data == rhs.data; 
} 
 
 
bool operator!=(myInputIterator const& lhs, myInputIterator const& rhs) { 
  return !(lhs == rhs); 
} 
 
 
int main() { 
  std::copy(myInputIterator("Hello world!"), myInputIterator(""), 
            std::ostream_iterator<char>(std::cout)); 
  return 0; 
} 
 
 
I am going to attach the compiler output. 
 
Regards 
 
Christoph

-- 
           Summary: input iterator concept too restrictive
           Product: gcc
           Version: 3.4.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: cludwig at cdc dot informatik dot tu-darmstadt dot de
                CC: gcc-bugs at gcc dot gnu dot org
  GCC host triplet: i686-pc-linux-gnu


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
@ 2004-06-23  9:30 ` cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-06-23 10:40 ` pcarlini at suse dot de
                   ` (6 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cludwig at cdc dot informatik dot tu-darmstadt dot de @ 2004-06-23  9:30 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cludwig at cdc dot informatik dot tu-darmstadt dot de  2004-06-23 09:16 -------
Created an attachment (id=6610)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=6610&action=view)
test program and compiler output


-- 


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-06-23  9:30 ` [Bug libstdc++/16154] " cludwig at cdc dot informatik dot tu-darmstadt dot de
@ 2004-06-23 10:40 ` pcarlini at suse dot de
  2004-06-23 16:08 ` cvs-commit at gcc dot gnu dot org
                   ` (5 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-06-23 10:40 UTC (permalink / raw)
  To: gcc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |pcarlini at suse dot de
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2004-06-23 10:30:00
               date|                            |


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-06-23  9:30 ` [Bug libstdc++/16154] " cludwig at cdc dot informatik dot tu-darmstadt dot de
  2004-06-23 10:40 ` pcarlini at suse dot de
@ 2004-06-23 16:08 ` cvs-commit at gcc dot gnu dot org
  2004-06-23 16:11 ` cvs-commit at gcc dot gnu dot org
                   ` (4 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-23 16:08 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-23 16:04 -------
Subject: Bug 16154

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	paolo@gcc.gnu.org	2004-06-23 16:03:52

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: boost_concept_check.h 

Log message:
	2004-06-23  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/16154
	* include/bits/boost_concept_check.h (struct _TrivialIteratorConcept):
	Don't require the _DefaultConstructibleConcept.
	(struct _ForwardIteratorConcept): Require it here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&r1=1.2531&r2=1.2532
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/boost_concept_check.h.diff?cvsroot=gcc&r1=1.17&r2=1.18



-- 


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (2 preceding siblings ...)
  2004-06-23 16:08 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-23 16:11 ` cvs-commit at gcc dot gnu dot org
  2004-06-23 16:19 ` pcarlini at suse dot de
                   ` (3 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-06-23 16:11 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-06-23 16:09 -------
Subject: Bug 16154

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	paolo@gcc.gnu.org	2004-06-23 16:09:48

Modified files:
	libstdc++-v3   : ChangeLog 
	libstdc++-v3/include/bits: boost_concept_check.h 

Log message:
	2004-06-23  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/16154
	* include/bits/boost_concept_check.h (struct _TrivialIteratorConcept):
	Don't require the _DefaultConstructibleConcept.
	(struct _ForwardIteratorConcept): Require it here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.2224.2.130&r2=1.2224.2.131
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/boost_concept_check.h.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.13.12.4&r2=1.13.12.5



-- 


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (3 preceding siblings ...)
  2004-06-23 16:11 ` cvs-commit at gcc dot gnu dot org
@ 2004-06-23 16:19 ` pcarlini at suse dot de
  2004-06-24  3:25 ` bkoz at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-06-23 16:19 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-06-23 16:11 -------
Fixed for 3.4.1.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED
   Target Milestone|---                         |3.4.1


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (4 preceding siblings ...)
  2004-06-23 16:19 ` pcarlini at suse dot de
@ 2004-06-24  3:25 ` bkoz at gcc dot gnu dot org
  2004-06-24  8:52 ` pcarlini at suse dot de
  2004-07-12 21:56 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: bkoz at gcc dot gnu dot org @ 2004-06-24  3:25 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From bkoz at gcc dot gnu dot org  2004-06-24 02:57 -------

It would probably be a good idea to update to current boost concept checking.

-benjamin

-- 


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (5 preceding siblings ...)
  2004-06-24  3:25 ` bkoz at gcc dot gnu dot org
@ 2004-06-24  8:52 ` pcarlini at suse dot de
  2004-07-12 21:56 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: pcarlini at suse dot de @ 2004-06-24  8:52 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pcarlini at suse dot de  2004-06-24 08:48 -------
> It would probably be a good idea to update to current boost concept checking.

Definitely. Unfortunately, however, the task is not trivial: many things have
changed in the general structure. I'll try...

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bkoz at redhat dot com


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


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

* [Bug libstdc++/16154] input iterator concept too restrictive
  2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
                   ` (6 preceding siblings ...)
  2004-06-24  8:52 ` pcarlini at suse dot de
@ 2004-07-12 21:56 ` cvs-commit at gcc dot gnu dot org
  7 siblings, 0 replies; 9+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2004-07-12 21:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2004-07-12 21:56 -------
Subject: Bug 16154

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	hammer-3_3-branch
Changes by:	paolo@gcc.gnu.org	2004-07-12 21:55:55

Modified files:
	libstdc++-v3   : ChangeLog.hammer 
	libstdc++-v3/include/bits: boost_concept_check.h 

Log message:
	2004-07-12  Paolo Carlini  <pcarlini@suse.de>
	
	PR libstdc++/16154
	* include/bits/boost_concept_check.h (struct _TrivialIteratorConcept):
	Don't require the _DefaultConstructibleConcept.
	(struct _ForwardIteratorConcept): Require it here.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.hammer.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.1.2.18&r2=1.1.2.19
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/boost_concept_check.h.diff?cvsroot=gcc&only_with_tag=hammer-3_3-branch&r1=1.9.12.1&r2=1.9.12.2



-- 


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


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

end of thread, other threads:[~2004-07-12 21:56 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-06-23  9:16 [Bug libstdc++/16154] New: input iterator concept too restrictive cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-06-23  9:30 ` [Bug libstdc++/16154] " cludwig at cdc dot informatik dot tu-darmstadt dot de
2004-06-23 10:40 ` pcarlini at suse dot de
2004-06-23 16:08 ` cvs-commit at gcc dot gnu dot org
2004-06-23 16:11 ` cvs-commit at gcc dot gnu dot org
2004-06-23 16:19 ` pcarlini at suse dot de
2004-06-24  3:25 ` bkoz at gcc dot gnu dot org
2004-06-24  8:52 ` pcarlini at suse dot de
2004-07-12 21:56 ` cvs-commit 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).