Debian Codegraph @

llvm-project/clang-tools-extra/docs/clang-tidy/checks/readability/avoid-const-params-in-decls.rst

raw
1 .. title:: clang-tidy - readability-avoid-const-params-in-decls
2
3 readability-avoid-const-params-in-decls
4 =======================================
5
6 Checks whether a function declaration has parameters that are top level
7 ``const``.
8
9 ``const`` values in declarations do not affect the signature of a function, so
10 they should not be put there.
11
12 Examples:
13
14 .. code-block:: c++
15
16 void f(const string); // Bad: const is top level.
17 void f(const string&); // Good: const is not top level.
18
19 Options
20 -------
21
22 .. option:: IgnoreMacros
23
24 If set to `true`, the check will not give warnings inside macros. Default
25 is `true`.