Fix implicit copy ctor and copy assignment operator warnings
when -Wdeprecated passed.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
It has side effects in the destructor. It's not copyable.
It could reasonably be made movable, however, now that we require C++11 as a host requirement. (It was written before that was true.)
LookupResult's copy ctor and assignment operator are used in Sema::LookupInlineAsmField(). Looks like these were added back in December.
I'll remove the defaults, from this patch, but not sure how to handle LookupInlineAsmField(). Will add author of that change.
OTOH, UnresolvedSetImpl requires an assignment operator since it's a base to UnresolvedSet which has an implicit assignment operator, so I think that change is correct.
I can change my code to avoid the copy ctor and assignment operator of LookupResult - In every iteration I only need to access 2 members of the previous LookupResult (isSingleResult() and getFoundDecl()), I can keep only them instead of the whole object.
Do you want me to upload a patch with this change?
Add move ctor and assignment operator defaults to match
UnresolvedSetImpl's contained SmallVector.
Add FIXME note to LookupResult. Will address FIXME once Marina's
pending change to Sema::LookupInlineAsmField() is available.
Btw, what do you think about making -Wdeprecated the default for llvm/clang builds?
With this change, llvm/clang will be clean. However, libcxx and libcxxabi have a bunch of throw warnings.
UNresolvedSetImpl isn't copy constructible, so should it really be copy
assignable? (it looks like it only needs to be so because of LookupResult -
so once LookupResult is fixed, UnresolvedSetImpl can go back to the way it
was)
Perhaps we should just wait for the fix for LookupResult copying in
SemaStmtAsm from Marina?
Are you planning to cleanup -Wdeprecated in libcxx and libcxxabi too?
I did most of the -Wdeprecated cleanup late last year - but when I tried to
turn it on I hit issues in various stdlibs, etc. It'd be great to finish
the cleanup, or suppress it in system headers, etc, and get it turned on.