[PATCH] Fix missing std::

Jakub Staszak kubastaszak at gmail.com
Wed Mar 20 17:39:28 PDT 2013


I find it very weird. It works the same way with g++ (4.2.1) and clang++ (trunk).

void f1(std::vector<int> &V) 
{
  pop_heap(V.begin(), V.end()); // <- OK, no error
}

void f2(int *A) 
{
  pop_heap(A, A + 10); // Error, no pop_heap (std::pop_heap suggested)
}

Does anyone know the reason?
- Kuba


On Mar 21, 2013, at 1:08 AM, Matt Arsenault <Matthew.Arsenault at amd.com> wrote:

> Not sure how this compiles for anyone else
> 
> http://llvm-reviews.chandlerc.com/D560
> 
> Files:
>  lib/CodeGen/MachineScheduler.cpp
>  lib/DebugInfo/DWARFDebugAranges.cpp
> 
> Index: lib/CodeGen/MachineScheduler.cpp
> ===================================================================
> --- lib/CodeGen/MachineScheduler.cpp
> +++ lib/CodeGen/MachineScheduler.cpp
> @@ -2182,7 +2182,7 @@
>   /// Callback to select the highest priority node from the ready Q.
>   virtual SUnit *pickNode(bool &IsTopNode) {
>     if (ReadyQ.empty()) return NULL;
> -    pop_heap(ReadyQ.begin(), ReadyQ.end(), Cmp);
> +    std::pop_heap(ReadyQ.begin(), ReadyQ.end(), Cmp);
>     SUnit *SU = ReadyQ.back();
>     ReadyQ.pop_back();
>     IsTopNode = false;
> Index: lib/DebugInfo/DWARFDebugAranges.cpp
> ===================================================================
> --- lib/DebugInfo/DWARFDebugAranges.cpp
> +++ lib/DebugInfo/DWARFDebugAranges.cpp
> @@ -186,7 +186,7 @@
>     Range range(address);
>     RangeCollIterator begin = Aranges.begin();
>     RangeCollIterator end = Aranges.end();
> -    RangeCollIterator pos = lower_bound(begin, end, range, RangeLessThan);
> +    RangeCollIterator pos = std::lower_bound(begin, end, range, RangeLessThan);
> 
>     if (pos != end && pos->LoPC <= address && address < pos->HiPC()) {
>       return pos->Offset;
> <D560.1.patch>_______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits





More information about the llvm-commits mailing list