[clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical type...
authorFelix Berger <flx@google.com>
Mon, 24 May 2021 13:14:59 +0000 (09:14 -0400)
committerFelix Berger <flx@google.com>
Wed, 9 Jun 2021 20:36:53 +0000 (16:36 -0400)
commitefa4dbc32ca9b7f3319edbcc6ac502ea962c8f0a
treee330f13fdb4b770689a8b72f22cddb2c8218f82b
parenta56bd7dec8da4348d847d53c96d8a30f4a821d36
[clang-tidy] performance-unnecessary-copy-initialization: Look at the canonical type when checking for aliases.

This fixes a false positive case where for instance a pointer is obtained and declared using `auto`.

Differential Revision: https://reviews.llvm.org/D103018

Reviewed-by: ymandel
clang-tools-extra/clang-tidy/performance/UnnecessaryCopyInitialization.cpp
clang-tools-extra/test/clang-tidy/checkers/performance-unnecessary-copy-initialization.cpp