This is an archive of the discontinued LLVM Phabricator instance.

[libc++] avoid g++9 Wdeprecated-copy in __hash_table & __tree
AbandonedPublic

Authored by rlibby on Dec 20 2019, 1:40 AM.

Details

Summary

g++9 now warns if a copy assignment operator is specified and a default
copy constructor is implicitly generated, or vice versa. libc++ tripped
these warnings with some copy assignment operators which were declared
private and not defined. Avoid the warnings by declaring them with
delete.

I should say that I am putting this patch up for comment without having
done all due diligence. I am not an expert here in any case, I don't
have a strong grasp of what's going on here and whether this patch is in
the right direction.

This assumes that the intention of these declarations really had been to
prevent use of the operator=, and that the existing uses of the
implicitly generated default copy constructors are intended and okay.

I have also not yet done useful testing with libcxx. I have however
checked that after applying this patch to the libcxx imported into
FreeBSD, that I no longer see the Wdeprecated-copy warnings upon
building C++ programs with g++9.

Event Timeline

rlibby created this revision.Dec 20 2019, 1:40 AM
rlibby updated this revision to Diff 234838.Dec 20 2019, 1:46 AM

style: tabs->spaces

Is this change against head? because I thought I already fixed this.

Is this change against head? because I thought I already fixed this.

Yes, I believe so. The patch is against 78d6a7767ed57b50122a161b91f59f19c9bd0d19 / trunk@375504 . Is there another branch I should be looking at?

rlibby abandoned this revision.Dec 20 2019, 9:49 PM

I was tracking stale source and @EricWF pointed me in the right direction.