Skip to content

error: definition of implicit copy assignment operator for 'SaveLayerOptions' is deprecated because it has a user-declared copy constructor #99795

Closed
flutter-team-archive/engine
#31934

Description

@jmagman

Version of clang in Xcode 13.0 has a new error:

In file included from ../../flutter/display_list/display_list_builder.h:8:
../../flutter/display_list/display_list.h:158:3: error: definition of implicit copy assignment operator for 'SaveLayerOptions' is deprecated because it has a user-declared copy constructor [-Werror,-Wdeprecated-copy]
  SaveLayerOptions(const SaveLayerOptions& options) : flags_(options.flags_) {}
  ^
../../flutter/display_list/display_list_builder.cc:283:21: note: in implicit copy assignment operator for 'flutter::SaveLayerOptions' first required here
        op->options = op->options.with_can_distribute_opacity();

Seen in flutter-team-archive/engine#31915 https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8820208992595983441/+/u/build_ios_debug_sim_arm64/stdout

Blocking #85555

flutter-team-archive/engine#30957 @flar

Activity

  1. added
    engineflutter/engine related. See also e: labels.
    P1High-priority issues at the top of the work list
    on Mar 9, 2022
  2. flar commented on Mar 9, 2022

    @flar
    Contributor

    It looks like it needs an explicit copy operator now. This patch might fix it?

    diff --git a/display_list/display_list.h b/display_list/display_list.h
    index ba255b576b..5fc03fc30d 100644
    --- a/display_list/display_list.h
    +++ b/display_list/display_list.h
    @@ -181,6 +181,11 @@ class SaveLayerOptions {
         return options;
       }
     
    +  SaveLayerOptions& operator=(const SaveLayerOptions& other) {
    +    flags_ = other.flags_;
    +    return *this;
    +  }
    +
       bool operator==(const SaveLayerOptions& other) const {
         return flags_ == other.flags_;
       }
    
  3. jmagman commented on Mar 9, 2022

    @jmagman
    MemberAuthor
  4. github-actions commented on Mar 24, 2022

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked as resolved and limited conversation to collaborators on Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1High-priority issues at the top of the work listengineflutter/engine related. See also e: labels.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions