public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/22070] New: including iostream causes lookup of std function to fail when passed into STL algorithm
@ 2005-06-14 23:11 jbeardsley at ncaustin dot com
  2005-06-14 23:15 ` [Bug libstdc++/22070] " pinskia at gcc dot gnu dot org
  0 siblings, 1 reply; 2+ messages in thread
From: jbeardsley at ncaustin dot com @ 2005-06-14 23:11 UTC (permalink / raw)
  To: gcc-bugs

The inclusion of iostream breaks the following program.  A workaround is to define an inline function that calls into tolower() and use it as the last argument to transform().

Code:

#include <cctype>
#include <string>
#include <algorithm>
#include <iostream>

int main()
{
  std::string foo("AbCd");
  std::transform(foo.begin(), foo.end(), foo.begin(), std::tolower);
  return 0;
}

Output:

Reading specs from /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/specs
Configured with: ../gcc-3.4.4/configure --prefix=/usr/local --enable-languages=c++
Thread model: posix
gcc version 3.4.4
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -E -quiet -v -D_GNU_SOURCE foo.cpp -mtune=pentiumpro -o foo.ii
ignoring nonexistent directory "/usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../i686-pc-linux-gnu/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../include/c++/3.4.4
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../include/c++/3.4.4/i686-pc-linux-gnu
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/../../../../include/c++/3.4.4/backward
 /usr/local/include
 /usr/local/lib/gcc/i686-pc-linux-gnu/3.4.4/include
 /usr/include
End of search list.
 /usr/local/libexec/gcc/i686-pc-linux-gnu/3.4.4/cc1plus -fpreprocessed foo.ii -quiet -dumpbase foo.cpp -mtune=pentiumpro -auxbase foo -version -o foo.s
GNU C++ version 3.4.4 (i686-pc-linux-gnu)
	compiled by GNU C version 3.4.4.
GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=129426
foo.cpp: In function `int main()':
foo.cpp:12: error: no matching function for call to `transform(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, <unknown type>)'

-- 
           Summary: including iostream causes lookup of std function to fail
                    when passed into STL algorithm
           Product: gcc
           Version: 3.4.4
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: jbeardsley at ncaustin dot com
                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=22070


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

* [Bug libstdc++/22070] including iostream causes lookup of std function to fail when passed into STL algorithm
  2005-06-14 23:11 [Bug c++/22070] New: including iostream causes lookup of std function to fail when passed into STL algorithm jbeardsley at ncaustin dot com
@ 2005-06-14 23:15 ` pinskia at gcc dot gnu dot org
  0 siblings, 0 replies; 2+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-06-14 23:15 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-06-14 23:15 -------
This is invalid, see PR 11108 which this is a dup of.

*** This bug has been marked as a duplicate of 11108 ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
          Component|c++                         |libstdc++
         Resolution|                            |DUPLICATE


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


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

end of thread, other threads:[~2005-06-14 23:15 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-06-14 23:11 [Bug c++/22070] New: including iostream causes lookup of std function to fail when passed into STL algorithm jbeardsley at ncaustin dot com
2005-06-14 23:15 ` [Bug libstdc++/22070] " 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).