Bug 13290 - [3.3 only] gcc 3.3.x: simple typo in concept checking for std::generate_n
Summary: [3.3 only] gcc 3.3.x: simple typo in concept checking for std::generate_n
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: libstdc++ (show other bugs)
Version: 3.3.2
: P2 normal
Target Milestone: 3.3.3
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2003-12-04 01:29 UTC by Christopher Saunders
Modified: 2003-12-04 19:35 UTC (History)
1 user (show)

See Also:
Host: i686-pc-linux-gnu
Target: i686-pc-linux-gnu
Build: i686-pc-linux-gnu
Known to work:
Known to fail:
Last reconfirmed: 2003-12-04 02:26:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Saunders 2003-12-04 01:29:05 UTC
In the latest gcc 3.3 snapshot (20031201) there is a typo in the concept
checking code for the c++ stdlib function generate_n, in:
{gccroot}/libstdc++-v3/include/bits/stl_algo.h
It looks like the phrase "__typeof__(gen())" was intented to be
"__typeof__(__gen())". This problem is already fixed in the latest mainline
snapshot (20031203). 

Here is the context:

"""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
$ diff -c stl_algo.h stl_algo_fix.h
*** stl_algo.h  Tue Sep 30 07:37:40 2003
--- stl_algo_fix.h      Wed Dec  3 16:55:36 2003
***************
*** 948,954 ****
        // concept requirements
        __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
              // "the type returned by a _Generator"
!             __typeof__(gen())>)

        for ( ; __n > 0; --__n, ++__first)
        *__first = __gen();
--- 948,954 ----
        // concept requirements
        __glibcpp_function_requires(_OutputIteratorConcept<_OutputIter,
              // "the type returned by a _Generator"
!             __typeof__(__gen())>)

        for ( ; __n > 0; --__n, ++__first)
        *__first = __gen();
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
Comment 1 Andrew Pinski 2003-12-04 02:26:54 UTC
This was fixed by on the mainline by:
        * config/locale/generic/c_locale.h: Include <cstdlib> and
        <cstring>.
        * include/bits/boost_concept_check.h: Add this-> to unqualified
        method calls.
        * include/bits/deque.tcc: Likewise.
        * include/bits/locale_facets.h : Likewise.
        * include/bits/ostream.tcc: Likewise.
        * include/bits/stl_algo.h: Likewise.
        * include/bits/stl_bvector.h: Likewise.
        * include/bits/stl_deque.h: Likewise.
        * include/bits/stl_list.h: Likewise.
        * include/bits/stl_tree.h: Likewise.
        * include/bits/stl_vector.h: Likewise.
        * include/bits/vector.tcc: Likewise.
        * include/ext/rope: Likewise.
        * include/ext/ropeimpl.h: Likewise.
        * include/ext/stdio_filebuf.h: Likewise.
Comment 2 GCC Commits 2003-12-04 18:45:49 UTC
Subject: Bug 13290

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	bkoz@gcc.gnu.org	2003-12-04 18:45:43

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

Log message:
	2003-12-04  Christopher Saunders  <ctsa@u.washington.edu>
	
	PR libstdc++/13290
	* include/bits/stl_algo.h (generate_n): Fix typo.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.1464.2.157&r2=1.1464.2.158
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/libstdc++-v3/include/bits/stl_algo.h.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.27.20.1&r2=1.27.20.2

Comment 3 Andrew Pinski 2003-12-04 19:35:31 UTC
Fix was checked in thanks.