In the following code:
cc struct Obj { Obj(); Obj(const Obj &); Obj(Obj &&); virtual ~Obj(); }; Obj ConstNrvo() { const Obj obj; return obj; }
performance-no-automatic-move warns about the constness of obj. However, NRVO
is applied to obj, so the const should have no effect on performance.
This change modifies the matcher to exclude NRVO variables.
#clang-tidy