This is an archive of the discontinued LLVM Phabricator instance.

[clang-tidy]performance-unnecessary-copy-initialization: fix false negative
ClosedPublic

Authored by courbet on Oct 28 2021, 8:08 AM.

Details

Summary

We're missing all cases where the return value is a type alias.

Unfortunately, this includes things we care about, such as
std::vector<T>::operator[] (return value is const_reference,
not const T&).

Match the canonical type instead.

Diff Detail

Event Timeline

courbet created this revision.Oct 28 2021, 8:08 AM
courbet requested review of this revision.Oct 28 2021, 8:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 28 2021, 8:08 AM
flx accepted this revision.Oct 28 2021, 8:18 AM

Thanks for the fix!

This revision is now accepted and ready to land.Oct 28 2021, 8:18 AM