Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Extend presubmit _CheckUniquePtr to multiline
The presubmit check _CheckUniquePtr guards against calling std::unique_ptr constructor directly, instead directing code authors to use std::make_unique. This check currently fails to match multiline expressions. While it catches bar = std::unique_ptr<T>(foo); it does not catch bar = std::unique_ptr<T>(foo); nor does it catch bar = std::unique_ptr<T>( foo); This CL fixes it by extending the match pattern to catch all lines with the substring "std::unique_ptr<T>(". (But not those with "std::unique_ptr<T>()", which should be handled by the "nullptr-check".) Bug: 827961 Change-Id: I376b5e9811418205e294e97de0b6b7bcbf6891d2 Reviewed-on: https://chromium-review.googlesource.com/989735 Commit-Queue: Vaclav Brozek <vabr@chromium.org> Reviewed-by: Jochen Eisinger <jochen@chromium.org> Cr-Commit-Position: refs/heads/master@{#548045}
- Loading branch information