New issue
Advanced search Search tips

Issue 592086 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Closed: Mar 2016
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 2
Type: Bug



Sign in to add a comment

WTF::Vector::prepend has a build error.

Project Member Reported by yhirano@chromium.org, Mar 4 2016

Issue description

In [1], the following code

 m_data.prepend(m_boundary);

doesn't compile (m_data and m_boundary are Vector<char>). The error message is:

../../third_party/WebKit/Source/wtf/Vector.h:1262:25: error: no viable conversion from 'WTF::Vector<char, 0, WTF::PartitionAllocator>' to 'char'
    new (NotNull, spot) T(std::forward<U>(*data));
                        ^ ~~~~~~~~~~~~~~~~~~~~~~
../../third_party/WebKit/Source/wtf/Vector.h:1284:5: note: in instantiation of function template specialization 'WTF::Vector<char, 0, WTF::PartitionAllocator>::insert<WTF::Vector<char, 0, WTF::PartitionAllocator> &>' requested here
    insert(0, std::forward<U>(val));
    ^
../../third_party/WebKit/Source/core/fetch/MultipartImageResourceParser.cpp:52:20: note: in instantiation of function template specialization 'WTF::Vector<char, 0, WTF::PartitionAllocator>::prepend<WTF::Vector<char, 0, WTF::PartitionAllocator> &>' requested here
            m_data.prepend(m_boundary);
                   ^
1 error generated.


1: https://codereview.chromium.org/1693183002/
 
Cc: yhirano@chromium.org
Components: Blink>Architecture
Workaround:

const auto& boundary = m_boundary;
m_data.prepend(boundary);

I don't know why it works.
Cc: -yhirano@chromium.org
Owner: yhirano@chromium.org
Status: Started (was: Untriaged)
Project Member

Comment 3 by bugdroid1@chromium.org, Mar 9 2016

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

commit c80deb3ba2db12ded8d637e467aed8366922913a
Author: yhirano <yhirano@chromium.org>
Date: Wed Mar 09 04:22:28 2016

Rename Vector::prepend to Vector::prependVector

template <typename U> prepend(U&&) shadows
template <typnemae U, size_t c, typename V> prepend(const Vector<U, c, v>&)
in some cases, so this CL renames the latter. This is also aligned with
append and appendVector.

BUG= 592086 

Review URL: https://codereview.chromium.org/1772823003

Cr-Commit-Position: refs/heads/master@{#380063}

[modify] https://crrev.com/c80deb3ba2db12ded8d637e467aed8366922913a/third_party/WebKit/Source/wtf/Vector.h

Status: Fixed (was: Started)

Comment 5 by tkent@chromium.org, Jun 23 2016

Components: -Blink>Architecture Blink>Internals
Renaming Blink>Architecture to Blink>Internals

Sign in to add a comment