Commit c65b4d03 authored by Stephan Hartmann's avatar Stephan Hartmann Committed by Commit Bot

GCC: make base::FilePath move assignment operator noexcept

The move assignment operator in PaintPreviewClient::PaintPreviewData is
noexcept. Because this class has a member of type base::FilePath, the
move assignment operator of base::FilePath must be noexcept too.

Otherwise GCC fails like this:

../../components/paint_preview/browser/paint_preview_client.cc:107:1:

error: function 'paint_preview::PaintPreviewClient::PaintPreviewData&
paint_preview::PaintPreviewClient::PaintPreviewData::operator=
(paint_preview::PaintPreviewClient::PaintPreviewData&&)' defaulted on
its redeclaration with an exception-specification that differs from
the implicit exception-specification ''
  107 | PaintPreviewClient::PaintPreviewData::operator=(
      | ^~~~~~~~~~~~~~~~~~

Bug: 819294
Change-Id: I87b88a81e8af6b7e61f0d1a8c8444fd6707e50d2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218168
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: default avatarLei Zhang <thestig@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772348}
parent fc850a4d
......@@ -186,7 +186,7 @@ FilePath::~FilePath() = default;
FilePath& FilePath::operator=(const FilePath& that) = default;
FilePath& FilePath::operator=(FilePath&& that) = default;
FilePath& FilePath::operator=(FilePath&& that) noexcept = default;
bool FilePath::operator==(const FilePath& that) const {
#if defined(FILE_PATH_USES_DRIVE_LETTERS)
......
......@@ -193,7 +193,7 @@ class BASE_EXPORT FilePath {
FilePath(FilePath&& that) noexcept;
// Replaces the contents with those of |that|, which is left in valid but
// unspecified state.
FilePath& operator=(FilePath&& that);
FilePath& operator=(FilePath&& that) noexcept;
bool operator==(const FilePath& that) const;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment