Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wdeprecated-copy warning when compiling with Clang trunk #948

Closed
haberman opened this issue Apr 26, 2021 · 4 comments
Closed

Wdeprecated-copy warning when compiling with Clang trunk #948

haberman opened this issue Apr 26, 2021 · 4 comments
Assignees
Labels

Comments

@haberman
Copy link

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.

@haberman haberman added the bug label Apr 26, 2021
@derekmauro
Copy link
Member

@vslashg - Can you take a look at this one?

@haberman
Copy link
Author

Ping? This is blocking builds against Clang trunk that use -Werror. It seems like the fix should not be too hard?

@JamesJCode
Copy link

@haberman Not a permanent solution, but I inject -Wno-deprecated-copy in my build to work around this. Using CMake:

add_subdirectory(ExternalLibs/abseil-cpp)
# Following two directives needed to work around https://github.com/abseil/abseil-cpp/issues/948
if(NOT MSVC)
    target_compile_options(absl_strings INTERFACE -Wno-deprecated-copy)
    target_compile_options(absl_flat_hash_map INTERFACE -Wno-deprecated-copy)
endif()

@derekmauro
Copy link
Member

There is an internal change (cl/374995948) pending for this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants