[PATCH] D53025: [clang-tidy] implement new check for const return types.

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Oct 17 16:21:17 PDT 2018


aaron.ballman added inline comments.


================
Comment at: test/clang-tidy/readability-const-value-return.cpp:174
+int **const * n_multiple_ptr();
+int *const & n_pointer_ref();
----------------
I'd like to see some more complex examples, like:
```
int const foo();
int const * const foo();

std::add_const<int> foo();

template <typename Ty>
std::add_const<Ty> foo();

auto foo() -> const int;
auto foo() -> int const;

template <typename Ty>
auto foo() -> std::add_const<Ty>;
```
I'm also very curious to hear how often this triggers on large code bases, especially ones that claim decent const-correctness.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D53025





More information about the cfe-commits mailing list