| 1 |
.. title:: clang-tidy - bugprone-suspicious-include |
| 2 |
|
| 3 |
bugprone-suspicious-include |
| 4 |
=========================== |
| 5 |
|
| 6 |
The check detects various cases when an include refers to what appears to be an |
| 7 |
implementation file, which often leads to hard-to-track-down ODR violations. |
| 8 |
|
| 9 |
Examples: |
| 10 |
|
| 11 |
.. code-block:: c++ |
| 12 |
|
| 13 |
#include "Dinosaur.hpp" // OK, .hpp files tend not to have definitions. |
| 14 |
#include "Pterodactyl.h" // OK, .h files tend not to have definitions. |
| 15 |
#include "Velociraptor.cpp" // Warning, filename is suspicious. |
| 16 |
#include_next <stdio.c> // Warning, filename is suspicious. |
| 17 |
|
| 18 |
Options |
| 19 |
------- |
| 20 |
.. option:: HeaderFileExtensions |
| 21 |
|
| 22 |
Default value: ``";h;hh;hpp;hxx"`` |
| 23 |
A semicolon-separated list of filename extensions of header files (the |
| 24 |
filename extensions should not contain a "." prefix). For extension-less |
| 25 |
header files, use an empty string or leave an empty string between ";" |
| 26 |
if there are other filename extensions. |
| 27 |
|
| 28 |
.. option:: ImplementationFileExtensions |
| 29 |
|
| 30 |
Default value: ``"c;cc;cpp;cxx"`` |
| 31 |
Likewise, a semicolon-separated list of filename extensions of |
| 32 |
implementation files. |