summaryrefslogtreecommitdiffstats
path: root/clang-tools-extra/docs/clang-tidy/checks/readability-avoid-const-params-in-decls.rst
blob: 3aea5d0c0753130c1a960ce00d11753b437608b8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
.. title:: clang-tidy - readability-avoid-const-params-in-decls

readability-avoid-const-params-in-decls
=======================================

Checks whether a function declaration has parameters that are top level
``const``.

``const`` values in declarations do not affect the signature of a function, so
they should not be put there.

Examples:

.. code-block:: c++

  void f(const string);   // Bad: const is top level.
  void f(const string&);  // Good: const is not top level.
OpenPOWER on IntegriCloud