Skip to content
Commit e51f4670 authored by Logan Gnanapragasam's avatar Logan Gnanapragasam Committed by Piotr Zegar
Browse files

[clang-tidy] ignore NRVO const variables in performance-no-automatic-move.

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

Reviewed By: courbet, PiotrZSL

Differential Revision: https://reviews.llvm.org/D147419
parent 92d854e2
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment