GCC: Recent noexcept move constructors change broke the build |
|||||
Issue descriptionhttps://chromium-review.googlesource.com/c/chromium/src/+/1046005 has broken the GCC build with errors such as: ../../components/search_provider_logos/logo_common.cc:31:1: error: function ‘search_provider_logos::LogoCallbacks::LogoCallbacks(search_provider_logos::LogoCallbacks&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’ LogoCallbacks::LogoCallbacks(LogoCallbacks&&) noexcept = default; ^~~~~~~~~~~~~ As explained in the CL, > LogoCallbacks contains OnceCallback members, and OnceCallback is not noexcept movable so GCC does not allow LogoCallbacks to be noexcept movable either. As far as I can tell GCC is correctly following the standard here. > I understand that, but = default *is* a deduction and C++ requires the exception specification of an explicitly-defaulted function to be compatible with the exception specification of the implicit declaration. Here the implicit declaration is not noexcept (because mojo::ScopedSharedBufferHandle is not noexcept), so using noexcept = default is illegal AFAIU (dcl.fct.def.default in C++11 standard). > Making *Callback, GURL and ScopedHandleBase noexcept movable should fix it I think. I'll try making a CL tomorrow. I'm filing the bug so that it's easier to keep track of what's going on, and people can chime in more easily here than in a CL that already landed.
,
May 15 2018
,
May 15 2018
,
May 15 2018
Retitling, this also affects older GCC releases.
,
May 15 2018
And just to clarify: we're not catching these errors because we build with -fno-exceptions?
,
May 15 2018
In a way, yes. If I do a regular build with clang but stop passing -fno-exceptions (and disable the #error at the end of base/allocator/allocator_shim.cc), `ninja search_provider_logos' fails with
LogoMetadata& LogoMetadata::operator=(LogoMetadata&&) noexcept = default;
^
../../components/search_provider_logos/logo_common.cc:31:16: error: exception specification of explicitly defaulted move constructor does not match the calculated one
LogoCallbacks::LogoCallbacks(LogoCallbacks&&) noexcept = default;
^
../../components/search_provider_logos/logo_common.cc:32:31: error: exception specification of explicitly defaulted move assignment operator does not match the calculated one
LogoCallbacks& LogoCallbacks::operator=(LogoCallbacks&&) noexcept = default;
^
,
May 18 2018
Issue 844355 has been merged into this issue.
,
May 18 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/f841ac2afe7ac227b760d0300f2abfbe4c278bae commit f841ac2afe7ac227b760d0300f2abfbe4c278bae Author: Jüri Valdmann <juri.valdmann@qt.io> Date: Fri May 18 22:36:28 2018 Mark base::*Callback, GURL and mojo::ScopeHandleBase as noexcept movable These types are used by search_provider_logos::LogoMetadata search_provider_logos::LogoCallbacks viz::InterprocessFramePool::PooledBuffer which are already using explicitly-defaulted ("= default") noexcept move constructors and assignment operators. This is illegal however, as C++ requires the exception specification of an explicitly-defaulted function to be compatible with the exception specification of the implicit declaration (see dcl.fct.def.default in C++11 standard). GCC considers this an error and Clang too, but only if compiling without -fno-exceptions. Bug: 843143 , 819294 Change-Id: I24fb8660b3e8c7748cf6b626292ebd6ddd971643 Reviewed-on: https://chromium-review.googlesource.com/1061464 Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Mike West <mkwst@chromium.org> Reviewed-by: Daniel Cheng <dcheng@chromium.org> Reviewed-by: danakj <danakj@chromium.org> Commit-Queue: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Cr-Commit-Position: refs/heads/master@{#560076} [modify] https://crrev.com/f841ac2afe7ac227b760d0300f2abfbe4c278bae/base/callback.h [modify] https://crrev.com/f841ac2afe7ac227b760d0300f2abfbe4c278bae/base/callback_internal.h [modify] https://crrev.com/f841ac2afe7ac227b760d0300f2abfbe4c278bae/mojo/public/cpp/system/handle.h [modify] https://crrev.com/f841ac2afe7ac227b760d0300f2abfbe4c278bae/url/gurl.cc [modify] https://crrev.com/f841ac2afe7ac227b760d0300f2abfbe4c278bae/url/gurl.h
,
May 28 2018
,
Jun 20 2018
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/a7d6d9872e267e3e970707e394e84092177b357d commit a7d6d9872e267e3e970707e394e84092177b357d Author: Raphael Kubo da Costa <raphael.kubo.da.costa@intel.com> Date: Wed Jun 20 21:33:02 2018 media capture, mojo: Sprinkle noexcept in a few more classes Commit fc5fe70812c ("FrameSinkVideoCapture clean-up: Remove unused APIs, style fixes") added the noexcept marker to FrameSinkVideoCapture's ConsumptionState inner class. This breaks the GCC build due to the fact that its members' types do not have noexcept themselves: ../../content/browser/media/capture/frame_sink_video_capture_device.cc: At global scope: ../../content/browser/media/capture/frame_sink_video_capture_device.cc:372:1: error: function ‘content::FrameSinkVideoCaptureDevice::ConsumptionState::ConsumptionState(content::FrameSinkVideoCaptureDevice::ConsumptionState&&)’ defaulted on its redeclaration with an exception-specification that differs from the implicit exception-specification ‘’ FrameSinkVideoCaptureDevice::ConsumptionState::ConsumptionState( clang is fine because we pass -fno-exceptions and it disables the same error there, while GCC continues to raise it ( bug 843143 and its corresponding CL have a longer discussion on this issue). In this case, mark CursorRendererUndoer as well as mojo's ubiquitous InterfacePtr with noexcept to fix the build. Bug: 754872 , 819294, 843143 Change-Id: I78714fda26d21e0979aed4fe26d543463dff9631 Reviewed-on: https://chromium-review.googlesource.com/1107918 Reviewed-by: Ken Rockot <rockot@chromium.org> Reviewed-by: Sergey Ulanov <sergeyu@chromium.org> Commit-Queue: Raphael Kubo da Costa (CET) <raphael.kubo.da.costa@intel.com> Cr-Commit-Position: refs/heads/master@{#569029} [modify] https://crrev.com/a7d6d9872e267e3e970707e394e84092177b357d/content/browser/media/capture/cursor_renderer.cc [modify] https://crrev.com/a7d6d9872e267e3e970707e394e84092177b357d/content/browser/media/capture/cursor_renderer.h [modify] https://crrev.com/a7d6d9872e267e3e970707e394e84092177b357d/mojo/public/cpp/bindings/interface_ptr.h |
|||||
►
Sign in to add a comment |
|||||
Comment 1 by raphael....@intel.com
, May 15 2018