4f31ec8
From c65b4d03c76da607b6b678c4a46baa75ca0cf7b3 Mon Sep 17 00:00:00 2001
4f31ec8
From: Stephan Hartmann <stha09@googlemail.com>
4f31ec8
Date: Wed, 27 May 2020 18:46:40 +0000
4f31ec8
Subject: [PATCH] GCC: make base::FilePath move assignment operator noexcept
4f31ec8
4f31ec8
The move assignment operator in PaintPreviewClient::PaintPreviewData is
4f31ec8
noexcept. Because this class has a member of type base::FilePath, the
4f31ec8
move assignment operator of base::FilePath must be noexcept too.
4f31ec8
4f31ec8
Otherwise GCC fails like this:
4f31ec8
4f31ec8
../../components/paint_preview/browser/paint_preview_client.cc:107:1:
4f31ec8
4f31ec8
error: function 'paint_preview::PaintPreviewClient::PaintPreviewData&
4f31ec8
paint_preview::PaintPreviewClient::PaintPreviewData::operator=
4f31ec8
(paint_preview::PaintPreviewClient::PaintPreviewData&&)' defaulted on
4f31ec8
its redeclaration with an exception-specification that differs from
4f31ec8
the implicit exception-specification ''
4f31ec8
  107 | PaintPreviewClient::PaintPreviewData::operator=(
4f31ec8
      | ^~~~~~~~~~~~~~~~~~
4f31ec8
4f31ec8
Bug: 819294
4f31ec8
Change-Id: I87b88a81e8af6b7e61f0d1a8c8444fd6707e50d2
4f31ec8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2218168
4f31ec8
Commit-Queue: Lei Zhang <thestig@chromium.org>
4f31ec8
Reviewed-by: Lei Zhang <thestig@chromium.org>
4f31ec8
Cr-Commit-Position: refs/heads/master@{#772348}
4f31ec8
---
4f31ec8
4f31ec8
diff --git a/base/files/file_path.cc b/base/files/file_path.cc
4f31ec8
index 6dc6854..56c02d2b 100644
4f31ec8
--- a/base/files/file_path.cc
4f31ec8
+++ b/base/files/file_path.cc
4f31ec8
@@ -186,7 +186,7 @@
4f31ec8
 
4f31ec8
 FilePath& FilePath::operator=(const FilePath& that) = default;
4f31ec8
 
4f31ec8
-FilePath& FilePath::operator=(FilePath&& that) = default;
4f31ec8
+FilePath& FilePath::operator=(FilePath&& that) noexcept = default;
4f31ec8
 
4f31ec8
 bool FilePath::operator==(const FilePath& that) const {
4f31ec8
 #if defined(FILE_PATH_USES_DRIVE_LETTERS)
4f31ec8
diff --git a/base/files/file_path.h b/base/files/file_path.h
4f31ec8
index 4e23f71a..2160fda 100644
4f31ec8
--- a/base/files/file_path.h
4f31ec8
+++ b/base/files/file_path.h
4f31ec8
@@ -193,7 +193,7 @@
4f31ec8
   FilePath(FilePath&& that) noexcept;
4f31ec8
   // Replaces the contents with those of |that|, which is left in valid but
4f31ec8
   // unspecified state.
4f31ec8
-  FilePath& operator=(FilePath&& that);
4f31ec8
+  FilePath& operator=(FilePath&& that) noexcept;
4f31ec8
 
4f31ec8
   bool operator==(const FilePath& that) const;
4f31ec8