Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(424)

Issue 882783002: Add missing .Pass() on return of SampleVector (Closed)

Created:
5 years, 11 months ago by scottmg
Modified:
5 years, 11 months ago
Reviewers:
Ilya Sherman
CC:
chromium-reviews, erikwright+watch_chromium.org, asvitkine+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@2015-histogram
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Add missing .Pass() on return of SampleVector On VS2015 without this causes: d:\src\cr3\src\base\metrics\histogram.cc(372): error C2248: 'scoped_ptr<base::SampleVector,base::DefaultDeleter<T>>::scoped_ptr': cannot access private member declared in class 'scoped_ptr<base::SampleVector,base::DefaultDeleter<T>>' with [ T=base::SampleVector ] d:\src\cr3\src\base\memory\scoped_ptr.h(312): note: see declaration of 'scoped_ptr<base::SampleVector,base::DefaultDeleter<T>>::scoped_ptr' with [ T=base::SampleVector ] I'm not entirely sure why this doesn't happen on earlier compilers, I guess something's move-ability changed. R=isherman@chromium.org BUG=440500 Committed: https://crrev.com/3bec0ffd9cfd92611182bc0f28e5dbc57f4cbaf1 Cr-Commit-Position: refs/heads/master@{#313378}

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1 line, -1 line) Patch
M base/metrics/histogram.cc View 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 12 (1 generated)
scottmg
5 years, 11 months ago (2015-01-27 18:53:00 UTC) #1
Ilya Sherman
LGTM, thanks.
5 years, 11 months ago (2015-01-27 21:37:31 UTC) #2
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/882783002/1
5 years, 11 months ago (2015-01-27 21:38:24 UTC) #4
commit-bot: I haz the power
Committed patchset #1 (id:1)
5 years, 11 months ago (2015-01-27 22:24:54 UTC) #5
commit-bot: I haz the power
Patchset 1 (id:??) landed as https://crrev.com/3bec0ffd9cfd92611182bc0f28e5dbc57f4cbaf1 Cr-Commit-Position: refs/heads/master@{#313378}
5 years, 11 months ago (2015-01-27 22:26:05 UTC) #6
brucedawson
Isn't scoped_ptr supposed to behave like unique_ptr, which is supposed to be returnable? http://isocpp.org/blog/2014/09/return-unique-ptr-by-value This ...
5 years, 11 months ago (2015-01-27 22:41:47 UTC) #7
scottmg
Maybe! I was going based on https://groups.google.com/a/chromium.org/d/msg/chromium-dev/RTd7rNxHjqk/1WHHvCdRP1UJ but... now that I look at the date, ...
5 years, 11 months ago (2015-01-27 22:45:06 UTC) #8
scottmg
It looks like, at least in Chrome, we can only avoid the Pass() for temporaries: ...
5 years, 11 months ago (2015-01-27 22:46:22 UTC) #9
jamesr
On 2015/01/27 22:46:22, scottmg wrote: > It looks like, at least in Chrome, we can ...
5 years, 11 months ago (2015-01-28 00:22:58 UTC) #10
scottmg
On 2015/01/28 00:22:58, jamesr wrote: > On 2015/01/27 22:46:22, scottmg wrote: > > It looks ...
5 years, 11 months ago (2015-01-28 00:34:08 UTC) #11
scottmg
5 years, 11 months ago (2015-01-28 00:54:02 UTC) #12
Message was sent while issue was closed.
On 2015/01/28 00:34:08, scottmg wrote:
> On 2015/01/28 00:22:58, jamesr wrote:
> > On 2015/01/27 22:46:22, scottmg wrote:
> > > It looks like, at least in Chrome, we can only avoid the Pass() for
> > > temporaries: http://www.chromium.org/developers/smart-pointer-guidelines
(?)
> > > 
> > 
> > This was necessary when we didn't use real rvalue refs to implement smart
> > pointers, but we do use them now (just like how we used to have to use
> PassAs<>
> > to do type coercions, couldn't use nullptr, etc).  This is an xvalue which
> > should bind to the rvalue ref c'tor.  Definitely seems like a VS2015 bug.
> 
> I see, so it's not matching the ctor&&, but should, and then is complaining
> because we disable the regular non-move ctor?

Filed https://connect.microsoft.com/VisualStudio/feedback/details/1105046.

Powered by Google App Engine
This is Rietveld 408576698