Skip to content

Wdeprecated-copy warning when compiling with Clang trunk #948

@haberman

Description

@haberman

Compiling ABSL at head with the trunk of Clang yields the following warning:

./absl/functional/function_ref.h:124:16: warning: definition of implicit copy constructor for 'FunctionRef<void (int, int, int)>' is deprecated because it has a user-declared copy assignment operator [-Wdeprecated-copy]
  FunctionRef& operator=(const FunctionRef& rhs) = delete;
               ^
absl/functional/function_ref_benchmark.cc:89:12: note: in implicit copy constructor for 'absl::FunctionRef<void (int, int, int)>' first required here
  Function f = c;

I'm not sure the correct fix or I'd submit a PR. I'm not sure if EnableIfCompatible should be updated to accept FunctionRef or if the copy constructor should be explicitly defined separately.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions