New issue
Advanced search Search tips

Issue 677044 link

Starred by 4 users

Issue metadata

Status: Fixed
Owner: ----
Closed: Apr 2018
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocked on:
issue 593874



Sign in to add a comment

std::vector doesn't support erase(const_iterator) on linux

Reported by dyaros...@yandex-team.ru, Dec 26 2016

Issue description

C++11 supports insert/erase with const_iterator.

However, it fails on linux:
error: no matching member function for call to 'erase'
  v.erase(v.cbegin());
  ~~^~~~~
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:986:7: note: candidate function not viable: no known conversion from '__normal_iterator<const_pointer, [...]>' to '__normal_iterator<pointer, [...]>' for 1st argument
      erase(iterator __position);
      ^
../../build/linux/debian_wheezy_amd64-sysroot/usr/lib/gcc/x86_64-linux-gnu/4.6/../../../../include/c++/4.6/bits/stl_vector.h:1007:7: note: candidate function not viable: requires 2 arguments, but 1 was provided
      erase(iterator __first, iterator __last);


 
Components: UI
Labels: TE-NeedsTriageHelp
Adding label TE-NeedsTriageHelp for further investigation as this issue is out of TE-scope.

Thanks...!!
Blockedon: 593874
Labels: -TE-NeedsTriageHelp
Status: Available (was: Unconfirmed)
Components: -UI Internals
Unfortunately this is still not fixed with GCC 4.8. It looks like we have to wait for GCC 4.9: https://gcc.gnu.org/onlinedocs/gcc-4.9.0/libstdc++/api/a01523_source.html#l01129
@jdoerrie

Can you please tell me, which compiler versions do we use?
GCC 6.3 is already out..
When you filed this bug we used the Debian Wheezy sysroot using GCC 4.6 (as you can see from the path in the compilation error). However, just last week we upgraded to Debian Jessie ( http://crbug.com/701894 ) using GCC 4.8. This means we  now can use more C++11 features like std::map::emplace, but std::vector::erase(const_iterator) is still not supported.
Project Member

Comment 7 by sheriffbot@chromium.org, Apr 6 2018

Labels: Hotlist-Recharge-Cold
Status: Untriaged (was: Available)
This issue has been Available for over a year. If it's no longer important or seems unlikely to be fixed, please consider closing it out. If it is important, please re-triage the issue.

Sorry for the inconvenience if the bug really should have been left as Available.

For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
Project Member

Comment 8 by bugdroid1@chromium.org, Apr 11 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/6af2a7536303e85f7be418c736d41d894378498f

commit 6af2a7536303e85f7be418c736d41d894378498f
Author: jdoerrie <jdoerrie@chromium.org>
Date: Wed Apr 11 07:23:58 2018

[base] Remove GCC 4.8 Workaround in base::flat_tree

This change removes a GCC 4.8 work around the lack of
std::vector::erase(const_iterator) from base::flat_tree.

Bug: 682254,  677044 
Change-Id: I8bd13851baa58c8cecd64c02c50bd999357afac4
Reviewed-on: https://chromium-review.googlesource.com/1005074
Reviewed-by: vmpstr <vmpstr@chromium.org>
Commit-Queue: Jan Wilken Dörrie <jdoerrie@chromium.org>
Cr-Commit-Position: refs/heads/master@{#549809}
[modify] https://crrev.com/6af2a7536303e85f7be418c736d41d894378498f/base/containers/flat_tree.h

Status: Fixed (was: Untriaged)

Sign in to add a comment