public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/44708]  New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
@ 2010-06-29  8:10 oakad at yahoo dot com
  2010-06-29  9:16 ` [Bug libstdc++/44708] " paolo dot carlini at oracle dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: oakad at yahoo dot com @ 2010-06-29  8:10 UTC (permalink / raw)
  To: gcc-bugs

The example program below will exhibit the problem when compiled with
-std=c++0x or gnu++0x flag. The fix appears to be trivial, but requires a
change to <ext/algorithm> header.

Example program:
#include <iostream>
#include <ext/rope>

using namespace std;

int main(int argc, char **argv)
{
        __gnu_cxx::crope line("test-test-test");

        cout << line.c_str() << endl;
        return 0;
}

Compilation error message:
In file included from
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:48,        
                 from
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/rope:2956,            
                 from testrope.cpp:2:                                           
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm: In
function &#8216;std::pair<_InputIter, _ForwardIter>
__gnu_cxx::copy_n(_InputIterator, _Size, _OutputIterator) [with _InputIterator
= char*, _Size = long unsigned int, _OutputIterator = char*]&#8217;:            
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:1090:  
instantiated from &#8216;static _CharT* __gnu_cxx::rope<_CharT,
_Alloc>::_S_flatten(__gnu_cxx::_Rope_RopeRep<_CharT, _Alloc>*, _CharT*) [with
_CharT = char, _Alloc = std::allocator<char>]&#8217;
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/ropeimpl.h:1621:  
instantiated from &#8216;const _CharT* __gnu_cxx::rope<_CharT, _Alloc>::c_str()
const [with _CharT = char, _Alloc = std::allocator<char>]&#8217;
testrope.cpp:10:   instantiated from here
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:127: error:
call of overloaded &#8216;__copy_n(char*&, long unsigned int&, char*&,
std::random_access_iterator_tag)&#8217; is ambiguous
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:78: note:
candidates are: std::pair<_InputIter, _ForwardIter>
__gnu_cxx::__copy_n(_InputIterator, _Size, _OutputIterator,
std::input_iterator_tag) [with _InputIterator = char*, _Size = long unsigned
int, _OutputIterator = char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/ext/algorithm:93: note:  
              std::pair<_InputIter, _ForwardIter>
__gnu_cxx::__copy_n(_RAIterator, _Size, _OutputIterator,
std::random_access_iterator_tag) [with _RAIterator = char*, _Size = long
unsigned int, _OutputIterator = char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_algo.h:1003:
note:                 _OutputIterator std::__copy_n(_RandomAccessIterator,
_Size, _OutputIterator, std::random_access_iterator_tag) [with
_RandomAccessIterator = char*, _Size = long unsigned int, _OutputIterator =
char*]
/usr/lib/gcc/x86_64-pc-linux-gnu/4.4.2/include/g++-v4/bits/stl_algo.h:988:
note:                 _OutputIterator std::__copy_n(_InputIterator, _Size,
_OutputIterator, std::input_iterator_tag) [with _InputIterator = char*, _Size =
long unsigned int, _OutputIterator = char*]


-- 
           Summary: Enabling -std=c++0x results in ambiguous function
                    overload in <ext/algorithm> header
           Product: gcc
           Version: 4.4.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: oakad at yahoo dot com
 GCC build triplet: x86_64-pc-linux-gnu
  GCC host triplet: x86_64-pc-linux-gnu
GCC target triplet: x86_64-pc-linux-gnu


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


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

* [Bug libstdc++/44708] Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
  2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
@ 2010-06-29  9:16 ` paolo dot carlini at oracle dot com
  2010-06-29  9:20 ` paolo dot carlini at oracle dot com
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-06-29  9:16 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from paolo dot carlini at oracle dot com  2010-06-29 09:15 -------
Fixing momentarily, thanks.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |paolo dot carlini at oracle
                   |dot org                     |dot com
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-06-29 09:15:47
               date|                            |


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


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

* [Bug libstdc++/44708] Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
  2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
  2010-06-29  9:16 ` [Bug libstdc++/44708] " paolo dot carlini at oracle dot com
@ 2010-06-29  9:20 ` paolo dot carlini at oracle dot com
  2010-06-29 10:04 ` paolo at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-06-29  9:20 UTC (permalink / raw)
  To: gcc-bugs



-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |4.5.1


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


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

* [Bug libstdc++/44708] Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
  2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
                   ` (3 preceding siblings ...)
  2010-06-29 10:04 ` paolo dot carlini at oracle dot com
@ 2010-06-29 10:04 ` paolo at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu dot org @ 2010-06-29 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from paolo at gcc dot gnu dot org  2010-06-29 10:04 -------
Subject: Bug 44708

Author: paolo
Date: Tue Jun 29 10:04:01 2010
New Revision: 161525

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161525
Log:
2010-06-29  Paolo Carlini  <paolo.carlini@oracle.com>

        PR libstdc++/44708
        * include/ext/algorithm (copy_n): Qualify __copy_n call with
        __gnu_cxx::
        * testsuite/ext/rope/44708.cc: New.

Added:
    branches/gcc-4_5-branch/libstdc++-v3/testsuite/ext/rope/44708.cc
Modified:
    branches/gcc-4_5-branch/libstdc++-v3/ChangeLog
    branches/gcc-4_5-branch/libstdc++-v3/include/ext/algorithm


-- 


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


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

* [Bug libstdc++/44708] Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
  2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
  2010-06-29  9:16 ` [Bug libstdc++/44708] " paolo dot carlini at oracle dot com
  2010-06-29  9:20 ` paolo dot carlini at oracle dot com
@ 2010-06-29 10:04 ` paolo at gcc dot gnu dot org
  2010-06-29 10:04 ` paolo dot carlini at oracle dot com
  2010-06-29 10:04 ` paolo at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu dot org @ 2010-06-29 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from paolo at gcc dot gnu dot org  2010-06-29 10:04 -------
Subject: Bug 44708

Author: paolo
Date: Tue Jun 29 10:03:36 2010
New Revision: 161524

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=161524
Log:
2010-06-29  Paolo Carlini  <paolo.carlini@oracle.com>

        PR libstdc++/44708
        * include/ext/algorithm (copy_n): Qualify __copy_n call with
        __gnu_cxx::
        * testsuite/ext/rope/44708.cc: New.

Added:
    trunk/libstdc++-v3/testsuite/ext/rope/44708.cc
Modified:
    trunk/libstdc++-v3/ChangeLog
    trunk/libstdc++-v3/include/ext/algorithm


-- 


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


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

* [Bug libstdc++/44708] Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header
  2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
                   ` (2 preceding siblings ...)
  2010-06-29 10:04 ` paolo at gcc dot gnu dot org
@ 2010-06-29 10:04 ` paolo dot carlini at oracle dot com
  2010-06-29 10:04 ` paolo at gcc dot gnu dot org
  4 siblings, 0 replies; 6+ messages in thread
From: paolo dot carlini at oracle dot com @ 2010-06-29 10:04 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from paolo dot carlini at oracle dot com  2010-06-29 10:04 -------
Fixed.


-- 

paolo dot carlini at oracle dot com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


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


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

end of thread, other threads:[~2010-06-29 10:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-29  8:10 [Bug libstdc++/44708] New: Enabling -std=c++0x results in ambiguous function overload in <ext/algorithm> header oakad at yahoo dot com
2010-06-29  9:16 ` [Bug libstdc++/44708] " paolo dot carlini at oracle dot com
2010-06-29  9:20 ` paolo dot carlini at oracle dot com
2010-06-29 10:04 ` paolo at gcc dot gnu dot org
2010-06-29 10:04 ` paolo dot carlini at oracle dot com
2010-06-29 10:04 ` paolo 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).