public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/47709] New: is_heap(standard iterator) becomes ambiguous in C++0x mode
@ 2011-02-12  6:36 jyasskin at gcc dot gnu.org
  2011-02-12 10:12 ` [Bug libstdc++/47709] " paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: jyasskin at gcc dot gnu.org @ 2011-02-12  6:36 UTC (permalink / raw)
  To: gcc-bugs

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

           Summary: is_heap(standard iterator) becomes ambiguous in C++0x
                    mode
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: jyasskin@gcc.gnu.org


$ cat test.cc
#include <ext/algorithm>
#include <vector>

void foo() {
  std::vector<int> v;
  is_heap(v.begin(), v.end());
}
$ g++-4.6svn -c test.cc
$ g++-4.6svn -c test.cc -std=c++0x
test.cc: In function ‘void foo()’:
test.cc:6:29: error: call of overloaded ‘is_heap(std::vector<int>::iterator,
std::vector<int>::iterator)’ is ambiguous
test.cc:6:29: note: candidates are:
include/c++/4.6.0/ext/algorithm:436:5: note: bool
__gnu_cxx::is_heap(_RandomAccessIterator, _RandomAccessIterator) [with
_RandomAccessIterator = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]
include/c++/4.6.0/bits/stl_heap.h:560:72: note: bool std::is_heap(_RAIter,
_RAIter) [with _RAIter = __gnu_cxx::__normal_iterator<int*, std::vector<int> >]


I believe the fix is to "using std::is_heap" into __gnu_cxx in C++0x mode
rather than redefining it there. Another possible fix would be to move
__normal_iterator out of __gnu_cxx to avoid ADL finding that is_heap, but that
wouldn't help people who have already "using __gnu_cxx::is_heap" into their
global namespaces.


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

end of thread, other threads:[~2011-02-12 21:29 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-12  6:36 [Bug libstdc++/47709] New: is_heap(standard iterator) becomes ambiguous in C++0x mode jyasskin at gcc dot gnu.org
2011-02-12 10:12 ` [Bug libstdc++/47709] " paolo.carlini at oracle dot com
2011-02-12 21:27 ` paolo at gcc dot gnu.org
2011-02-12 21:29 ` paolo.carlini at oracle dot com
2011-02-12 21:29 ` paolo at gcc dot gnu.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).