New issue
Advanced search Search tips

Issue 798708 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Jan 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Android , Windows , iOS , Chrome , Mac , Fuchsia
Pri: 3
Type: Bug

Blocking:
issue 521269



Sign in to add a comment

Optional should not be calling T::new()

Project Member Reported by mlamouri@chromium.org, Jan 3 2018

Issue description

Optional is calling `new` instead `::new`, incorrectly calling `T::new()`. this is not following the C++ specification.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Jan 3 2018

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

commit 3f24be8edd26a9b2a32fa60d902143dae6136ed0
Author: Mounir Lamouri <mlamouri@chromium.org>
Date: Wed Jan 03 20:57:36 2018

base::Optional: do not use T::new() but ::new.

This is also adding unit tests that check that the default ctor is not
called.

Bug:  798708 
Change-Id: Ib8efb330d10517cb539fa4617e3f4fb3723d1dc0
Reviewed-on: https://chromium-review.googlesource.com/848715
Commit-Queue: Mounir Lamouri <mlamouri@chromium.org>
Reviewed-by: danakj <danakj@chromium.org>
Cr-Commit-Position: refs/heads/master@{#526804}
[modify] https://crrev.com/3f24be8edd26a9b2a32fa60d902143dae6136ed0/base/optional.h
[modify] https://crrev.com/3f24be8edd26a9b2a32fa60d902143dae6136ed0/base/optional_unittest.cc

Thanks very much for all your followups working on this class. I really appreciate it - as do the many users of the class :)
Status: Fixed (was: Started)
Thanks for the support :)

Sign in to add a comment